( ADB Help ) how-to set ADB & Windows $Path - HTC EVO 3D

HOW-TO Fix **ADB is not recognized in the CMD**​
Navigate to & Left_Click on Start >
Right_Click on Computer >
Left_Click on Advance System Settings >
Left_Click on Environment Variables >
Left_Click on New ( User Variables ) >
Variables Name: ADB ( Or anything you want )
Variables Value: ;C:\SDK\tools ( Just like this, This is the Path of my adb.exe )
You must put a ; in front of ;C:\ ( adb Path goes here / Variables Value: )
That's it.. You now have set up adb to work Global via cmd prompt on win7
~Eugene

eugene373 said:
HOW-TO Fix **ADB is not recognized in the CMD**​
Navigate to & Left_Click on Start >
Right_Click on Computer >
Left_Click on Advance System Settings >
Left_Click on Environment Variables >
Left_Click on New ( User Variables ) >
Variables Name: ADB ( Or anything you want )
Variables Value: ;C:\SDK\tools ( Just like this, This is the Path of my adb.exe )
You must put a ; in front of ;C:\ ( adb Path goes here / Variables Value: )
That's it.. You now have set up adb to work Global via cmd prompt on win7
~Eugene
Click to expand...
Click to collapse
or you can just open up command prompt and cd^ (adb folder location)

thesparky007 said:
or you can just open up command prompt and cd^ (adb folder location)
Click to expand...
Click to collapse
or copy the exe and the needed dll's to system32
however when i type adb it better just work regardless of what folder I'm in...
If you are running .bat & a Noob it will never work.... Just follow the Directs posted in OP

Thanks OP for the tip.
This is the easiest way to start adb.

OK, so I don't know what I did wrong but I named the variable name to adb and then the variable value ;C:\Program Files (x86)\Android\android-sdk\platform-tools which is where my adb.exe is located. But if I open up a command prompt and do adb devices it says:
C:\Users\Tiffany>adb devices
'adb' is not recognized as an internal or external command,
operable program or batch file.
If I cd to that location adb works but I thought it would be cool to just open a command prompt and be able to use adb but it's not working for me. Any suggestions or do u see anything wrong?

Tiffany84 said:
OK, so I don't know what I did wrong but I named the variable name to adb and then the variable value ;C:\Program Files (x86)\Android\android-sdk\platform-tools which is where my adb.exe is located. But if I open up a command prompt and do adb devices it says:
C:\Users\Tiffany>adb devices
'adb' is not recognized as an internal or external command,
operable program or batch file.
If I cd to that location adb works but I thought it would be cool to just open a command prompt and be able to use adb but it's not working for me. Any suggestions or do u see anything wrong?
Click to expand...
Click to collapse
Tiffany, try this from a cmd prompt:
path = %path%;C:\Program Files (x86)\Android\android-sdk\platform-tools
then adb should work regardless of where you are in cmd

RyteSyde said:
Tiffany, try this from a cmd prompt:
path = %path%;C:\Program Files (x86)\Android\android-sdk\platform-tools
then adb should work regardless of where you are in cmd
Click to expand...
Click to collapse
AHH, You are awesome. That worked. So should I delete that variable that I added or just leave it there?
Edit: Ok. So it works when I add that path but if I close that prompt and then reopen and try to use adb with out adding that path again I get the error. So do I have to do that every time I open the command prompt?

Tiffany84 said:
AHH, You are awesome. That worked. So should I delete that variable that I added or just leave it there?
Edit: Ok. So it works when I add that path but if I close that prompt and then reopen and try to use adb with out adding that path again I get the error. So do I have to do that every time I open the command prompt?
Click to expand...
Click to collapse
No you shouldn't have to if you open the cmd window with admin rights and set the path=. Run cmd as administrator or use the posts above and edit the path variable and add a ; to the end of it and then the path to platform-tools
either way should work
and if you get that to stick you won't need the other variable you added before

RyteSyde said:
No you shouldn't have to if you open the cmd window with admin rights and set the path=. Run cmd as administrator or use the posts above and edit the path variable and add a ; to the end of it and then the path to platform-tools
either way should work
and if you get that to stick you won't need the other variable you added before
Click to expand...
Click to collapse
Ok, so I ran the cmd prompt as admin and it still won't stick. So your saying I need to add ; before C: and at the end of it? Sorry. Not the greatest with pc's. Thanks for trying to help though.

Tiffany84 said:
Ok, so I ran the cmd prompt as admin and it still won't stick. So your saying I need to add ; before C: and at the end of it? Sorry. Not the greatest with pc's. Thanks for trying to help though.
Click to expand...
Click to collapse
whatever is in your path variable, leave that and just add this to the end:
;C:\Program Files (x86)\Android\android-sdk\platform-tools

RyteSyde said:
whatever is in your path variable, leave that and just add this to the end:
;C:\Program Files (x86)\Android\android-sdk\platform-tools
Click to expand...
Click to collapse
I named it adb and then the blank spot for the value I just copied and pasted what u had and still nothing. I give up. I guess stuff isn't meant to be easy for me. Story of my life. Thank u so much for trying to help.

Tiffany84 said:
I named it adb and then the blank spot for the value I just copied and pasted what u had and still nothing. I give up. I guess stuff isn't meant to be easy for me. Story of my life. Thank u so much for trying to help.
Click to expand...
Click to collapse
I was referring to updating the system path. Where you created the variable, underneath that should be the "System variables" section. Scroll down in that the the variable "path" and double click it. Move the cursor to the end of the line entry and paste in the ;C:\...etc... line from above

RyteSyde said:
I was referring to updating the system path. Where you created the variable, underneath that should be the "System variables" section. Scroll down in that the the variable "path" and double click it. Move the cursor to the end of the line entry and paste in the ;C:\...etc... line from above
Click to expand...
Click to collapse
BAM!!!!!!!!!!!!!!!!!!!!! Thank u for not giving up on me even though I had. That did it. I"M giving u all my thanks for the day. Thank u again. I really appreciate it.

Tiffany84 said:
BAM!!!!!!!!!!!!!!!!!!!!! Thank u for not giving up on me even though I had. That did it. I"M giving u all my thanks for the day. Thank u again. I really appreciate it.
Click to expand...
Click to collapse
it's no root but glad I could help

RyteSyde said:
it's no root but glad I could help
Click to expand...
Click to collapse
Definitely not root but hey, still pretty cool.

Thread moved to General as not development, thanks for sharing though

I always wanted to know how to set adb so you can use it anywhere. Editing the path in the system variable worked for me. Thanks RyteSyde.

The right way to avoid weird issues.... [Noob Proof sorry in advance]
It actually works perfect if you just do the following:
1. Right Click My Computer -> Properties
2. On the left pane, Find and Click "Advanced system settings"
3. Under the "Advanced" Tab Find and Click "Environment Variables..."
4. In the box for "User variables for [your name here; e.g. David]" there will be a button that says "New..." Click it.
5. Now you have a box in front of you with two fields:
1. Variable name: entering path here is really safer and can help to avoid clogging up the environment namespaces (cluttering your ram/registry)
Code:
Path
2. Variable value: directory containing the adb.exe you want to use**; i.e.
Code:
C:\Android\sdk\platform-tools
**to find this with ease search for "adb.exe" or look for it in "...sdk\platform-tools\" or "sdk\tools".
**This is a version dependent thing for the Android SDK which folder its in.
6. Click OK on all the dialogs and exit the windows we opened here.
7. Hit the windows key + R and type cmd.exe; hit Enter
8. Type adb into the newly opened cmd window. hit Enter
9. If adb runs all is well. Your DONE. If not continue to step 10.
--If it work stop here!--
10. At this point we are going to select our entry from step 5. (in Environment variables...)and delete it. Otherwise windows has two pointers to our adb.exe.
11. Navigate in the "System variables" box and scroll down until you see Path in the Variable Column. Select it and Click "Edit..."
12. Click inside "Variable value:" go to the very end of this and drop a ";" no spaces. Enter the value from Step 5.2
13. Click OK/Apply on all dialogs and reboot your PC.
14. Repeat steps 7-9 and if all is well your done. If not you may need to redownload the AndroidSDK from here: http://developer.android.com/sdk/index.html then repeat this guide.
The reason for first trying to do this under "User" as opposed to "System" is if you need to track your changes to Path in case anything goes wrong as it can be a daunting task to go through the System version (its really full of stuff that needs to be there XD )
But don't take my word for it: My path
Code:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static
and my Windows is brand new Store-bought not OEM. It tends get get bigger the more stuff windows needs to globally keep track of that doesn't live in C:\Windows\
Hope this helped!

RyteSyde said:
whatever is in your path variable, leave that and just add this to the end:
;C:\Program Files (x86)\Android\android-sdk\platform-tools
Click to expand...
Click to collapse
I could really use some help I have a windows vista 32-bit
The first time I tried to set up adb I messed up bad and deleted my original environment variable path
so now I can't even do it because I need my original environment variable path then ;C:\Program Files (x86)\Android\android-sdk\platform-tools
I didn't create a system restore point so I am screwed is there anyway I can recover my original environment variable path?

Grandkai said:
I could really use some help I have a windows vista 32-bit
The first time I tried to set up adb I messed up bad and deleted my original environment variable path
so now I can't even do it because I need my original environment variable path then ;C:\Program Files (x86)\Android\android-sdk\platform-tools
I didn't create a system restore point so I am screwed is there anyway I can recover my original environment variable path?
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=2317790
I would personally use this seeing it's one click go.

Related

[Q] Change Lock Screen Timeout

I have CM7 installed... I know there are settings for screen timeout under display, and CM7 settings allow you to specify the delay for the screen to actually lock. But what about when the screen is locked, you turn it on to check the time and it shuts off after 5 secs. Can this be changed?
Edit: Here's a list of important posts so people don't have to read the entire thread...
Background Info
Step-by-step guide for windows
Allow .jar files to be seen in APK Manager
How-to deODEX android.policy.jar for ODEXed ROMs
How-to for linux/mac(will make a better guide once I finish porting the APK Manager tool from Windows)
Old Stuff:There's not a setting to change the lock screen timeout but I got to looking around and think I found where it can be changed. The stuff I found pointed to android.policy.jar which is located in /system/framework so I adb pulled it and then decoded it using apktool. Some smali files contain hex values of 0x1388 equals 5000 in decimal where 5000ms = 5s. So one of those should be what we want to change. I'm going to try figuring out which one to change, set it to 10s = 10000ms = 0x2710. If it works for me, I can describe how to do it yourself in better detail and/or post a modified android.policy.jar with the timeout you would like.
Edit: I started a thread about this in the Eris dev forum and removed the attached files from here. PM me or post in one of these two threads if you have questions or would like me to modify and send you a custom android.policy.jar
http://forum.xda-developers.com/showthread.php?t=1079844
I successfully increased the default 5s timeout when you wake the phone but don't unlock. If you want to test it out, download one of the attached zip files corresponding to the timeout you would like to have(10s or 30s). Extract android.policy.jar from the zip file and follow either the ADB or Root Explorer or Terminal Emulator instructions below.
If using ADB:
Code:
adb remount
adb shell
cd /system/framework
mv android.policy.jar android.policy.jar.bak
exit
adb push android.policy.jar /system/framework
adb shell
cd /system/framework
chown 0:0 android.policy.jar
chmod 644 android.policy.jar
#reboot to recovery#
#wipe both cache and dalvik-cache#
#reboot#
If using Root Explorer on phone:
mount system as r/w
rename original android.policy.jar in /system/framework to android.policy.jar.bak
move modified android.policy.jar to /system/framework
change owner: owner = 0 - root & group = 0 - root
change permissions: rw-r--r--
#reboot to recovery#
#wipe both cache and dalvik-cache#
#reboot#
Click to expand...
Click to collapse
If using Terminal Emulator on phone:
Code:
mount -o remount,rw /dev/block/mtdblock3 /system
mv /system/framework/android.policy.jar /system/framework/android.policy.jar.bak
mv /PATH/TO/NEW/android.policy.jar /system/framework
cd /system/framework
chown 0:0 android.policy.jar
chmod 644 android.policy.jar
#reboot to recovery#
#wipe both cache and dalvik-cache#
#reboot#
Later tonight or tomorrow I will post a how-to so anyone can make the necessary modifications themselves. That should allow for other devices/ROMs to modify theirs as well since it will be customized to their phone.
I've only tested this on my Eris running GSB v3.1 - Gingerbread 2.3.4 - CM 7.1.0 RC0. Be sure to make a NAND backup and a backup of android.policy.jar as I can't guarantee this will work for you. If you have problems or just want to switch back to the original 5s timeout, replace the modified android.policy.jar with the android.policy.jar backup, wipe cache & dalvik-cache, and reboot or restore from the NAND backup you created.
I'm really surprised no one has brought this idea up before..well glad I had a chance to give you something to dig into and explore some more. I haven't done any editing to system files like this before so I might be posting back with some questions. Thanks for the info..I'll let you know how it goes!
When I plug my phone in it doesnt seem to be going into debugging mode. I have that option checked for it to enable when USB is plugged in but the only icon showing is the USB icon.
I say this because when I run adb devices its not listing my device..also running adb shell it says error: device not found
I havent tried running the adb shell since I flashed to CM7..is there something I need to do differently with this ROM?
thetornado said:
When I plug my phone in it doesnt seem to be going into debugging mode. I have that option checked for it to enable when USB is plugged in but the only icon showing is the USB icon.
I say this because when I run adb devices its not listing my device..also running adb shell it says error: device not found
I havent tried running the adb shell since I flashed to CM7..is there something I need to do differently with this ROM?
Click to expand...
Click to collapse
The debugging notification will only show up if the option for "USB debugging notify" is also checked in Settings->Applications->Development. Not sure why it wouldn't be able to find your phone especially since it sounds like you had it working fine before. What version of adb do you have? I'm using v1.0.26 and never had any problem. You can check the version with the command "adb version". You could also try using adbWireless which would allow you to not have it hooked to your computer with the USB cable.
Scratch that last post..I got it working in ADB Shell
I downloaded the APK tool and moved the files to C:\Windows
Ran this successful: adb pull /system/framework/android.policy.jar
Problem with: apktool d android.policy.jar out - error saying it couldn't find apktool. I went to restart my phone to see if that was an issue and now its hung on the white android screen and wont boot up
Thoughts?
You didn't actually modify anything on the phone right? And didn't push anything to it either? If not, nothing would have changed and it shouldn't be having a problem booting. Try "adb reboot recovery", wipe cache & dalvik-cache then reboot. If you can't run adb commands...pull the battery, put it back in, power it on and hold volume up + power to get into recovery. If something was modified, use adb to revert the modded files back to the originals or restore with a NAND backup if you made one.
Edit: As for apktool not being found, it sounds like apktool is not in your PATH. The Windows folder should be part of your PATH by default. You could check your PATH variable by following these instructions and modify it if needed or you try moving the unpacked apktool files to the same location as the adb command which is most likely /PATH/TO/ANDROID_SDK/platform-tools OR /PATH/TO/ANDROID_SDK/tools
Sorry for the delay..got back to trying this mod. I got an error..
C:\Users\ME\apktool d android.policy.jar out
Unable to access jarfile C:\Windows\\apktool.jar
Did I put these 3 files in the wrong location?
I just saw your comment about putting these files into where adb.exe is located. I moved these files there..also checked my path and its set up for:
Variable: path
Value: C:\android-sdk\platform-tools
The error I got now is: Unable to access jarfile C:\android-sdk\platform-tools\\apktool.jar
I'm not all that familiar with how Windows handles things but something it should be able to find apktool.jar if it's the same directory as apktool.bat. What is the contents of apktool.bat? A workaround would be manually doing the .bat file's job and run "apktool" using this command instead:
Code:
"java -jar /LOCATION/OF/apktool.jar"
Typing that in a cmd window should give you the usage output for apktool. If that works, you could then use that format to decode and build apk/jar files.
I have everything in the folder: C:\android-sdk\platform-tools
Contents of 'apktool.bat':
@echo off
java -jar "%~dp0\apktool.jar" %1 %2 %3 %4 %5 %6 %7 %8 %9
I am getting this error:
C:\Users\ME>java -jar C:\android-sdk\platform-tools\apktool.jar
Unable to access jarfile C:\android-sdk\platform-tools\apktool.jar
Ok...two more things to try.
Add the location of the java commands to the PATH variable. Probably somewhere like C:\jdk1.6.0_##\bin OR C:\Program Files\Java\jdk1.6.0_##\bin. The PATH variable as a whole would now be something like this: C:\LOCATION\OF\jdk1.6.0_##\bin;C:\WINDOWS\system32;C:\WINDOWS
If that doesn't help: change directory(cd) to C:\android-sdk\platform-tools in the cmd prompt, then run "java -jar apktool.jar"
Sorry it's being such a PITA to just get apktool to run.
1. The location of my Java program is: C:\Program Files\Java - There are 3 folders in there: jdk1.6.0_25, jre1.6.0_22, jre6 - I currently have a user variable 'path' with the value 'C:\android-sdk\platform-tools' - should it be added after this? ..if so, could you explain from what I gave about java what I need to add?
2. Tried cd - same thing..Unable to access jarfile
What does the following command give as output?
Code:
echo %PATH%
I'd set your system environment variable PATH like so:
right-click my computer -> properties -> advanced system settings -> Environment Variables...
under system variables, select Path, and Edit...
add the following(without the quotes) to the end of what's already there: ";C:\Program Files\Java\jdk1.6.0_25\bin;C:\android-sdk\platform-tools;C:\android-sdk\tools"
Also, since you are running Windows...it might make things easier on you to use APK Manager. Here's the thread for it: http://forum.xda-developers.com/showthread.php?t=695701
Here is what I have from the echo %PATH%
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I installed the APK manager..I have it up and running. So I pulled the 'android.policy.jar' - Now what do I do to edit this file?
With all the storms, a power outage, and being busy I'm just now able to get back to you. I'm going to try going through the process using APK Manager on a Windows desktop I have access to. Step-by-step instructions will be in the post below.
Step-by-Step for Windows
You will need the java jdk installed and ADB set up for this to work.
download APK Manager and extract it to you preferred location
this guide will use C:\apk_manager_4.9
run C:\apk_manager_4.9\Script.bat
select option 0 to adb pull
where = /system/framework/android.policy.jar
stored name = android.policy.jar
current project = y
select option 9 to decompile
minimize Script.bat window
use Notepad++(or your preferred editor) to open:
Code:
C:\apk_manager_4.9\projects\android.policy.jar\smali\com\android\internal\policy\KeyguardViewMediator.smali
find ".method public pokeWakelock()V" NOT ".method public pokeWakelock(I)V"
inside the method, find the two lines starting with "const/16 v#" followed by a hex value(0x####)
the second(0x1388=5000ms=5s) is the default timeout unless a hardware keyboard is open, in which case the first(0x2710=10000ms=10s) is used
the values are 16-bit signed integers so the highest either can be set is 0x7FFF=32767ms=32.767s (Your screen will not wake up if set higher)
use this dec->hex convertor to determine the hex equivalent of your desired ms timeout
modify the hex values to your liking, save the file, and close Notepad++
return to the Script.bat window
select option 11 to compile
system apk = y
additional files = n
select option 8 to adb push
where&name = /system/framework/android.policy.jar
select option 24 to quit
open a command prompt to run these commands:
Code:
adb shell chmod 644 /system/framework/android.policy.jar
adb reboot recovery
in recovery,wipe dalvik-cache & cache, then reboot
Done!
All GOOD! Thanks for your hard work on figuring all this out for windows..it really wasn't hard at all once I had the right set of instructions haha
The only thing I've noticed is that the "screen off animation" does not work now - I have checked and unchecked it and its still not working..its really no biggie but just thought I'd say in case you want to play around with this mod more.
thetornado said:
All GOOD! Thanks for your hard work on figuring all this out for windows..it really wasn't hard at all once I had the right set of instructions haha
The only thing I've noticed is that the "screen off animation" does not work now - I have checked and unchecked it and its still not working..its really no biggie but just thought I'd say in case you want to play around with this mod more.
Click to expand...
Click to collapse
I'm glad we finally got it figured out for you. I have the screen animation turned off on my Eris so I didn't notice this broke it. I'll look into it and see if I can figure anything out. The first thing that comes to mind is that the screen off animation could somehow be dependent on the AWAKE_INTERVAL_DEFAULT_MS variable. As I found when first looking at this mod, changing the variable won't actually affect the value wherever it is used since the package is already compiled. So if the animation does use that variable in some way, we'll need to find where that happens and change the value there.

PLEASE HELP, Just stuck in 1 tiny step!

SO I Followed this tutorial chrg.zxq.net/htc-legend-root.html done everything perfectly until this step
"Then we have to type the following into CMD:"
/data/local/flash_image misc /data/local/misc1-2.img
When i type in the above i get this data/local/fash_image: not found
this is what i have in my android sdk platform-tools folder.
please help
Hi pappa9,
try to start crackin.bat before that
You need to move the following files from "C:\android-sdk\platform-tools" to "C:\android-sdk\tools":
adb.exe
AdbWinApi.dll
AdbWinUsbApi.dll
It's the "tools" folder you're supposed to extract the hack4legend, & crackin.bat.
So not in "platform-tools".
It might work to use the crackin.bat from "platform-tools" folder instead of "tools", it didnt work for me at least. But you need to make sure the above mentioned files are located in the same folder as crackin.bat
I had similar issue, and this worked for me. Hope it helps!

[Q] ubuntu 12.10 flashtool

I installed ubuntu 12.10 as my only OS now my question is can I use Flashtools? following various guides I found a wild where he said that Flashtools of ubuntu did not work for flashing the kernel, and if so do I have to install windows?
I downloaded Flashtools for ubuntu I extracted the folder but I can not start the program can anyone tell me how to do?
when i try to open flashtools answer me thisView attachment 1504335
I do run but nothing happens
Flashtool works just fine with any linux distro, so does fastboot which u can use to flash kernel.
I'm using debian unstable and both working great.
Anyway u should atleast explain what does the error in screenshot mean, in english.
ubuntu asks me how to open the file asks me if I run it in terminal or run normally, but nothing happens in any of the ways
try run it directly in terminal. by the screenshot it should be
Code:
cd ~/FlashTool
./FlashTool
I think the problem is java....View attachment 1504353
you need to take it from oracle.com and install it for your distro.
it should set your java_home by default and if not put it into ~./bashrc
exactly. its java. flashtool needs java installed, either oracle jdk or openjdk.
with regard to the recognition of the device in fastboot I need the drivers? for ubuntu I do not know where to get the driver for my xperia active
no. u dont need driver whatsoever for linux. just need adb and fastboot to set up correctly.
u should install android sdk, it'll pull adb and fastboot too.
then just add path to adb and fastboot into your bashrc, add semc usb device id in udev rules, reboot once and u good to go.
still nothing I'm doing something wrong but I do not understand what
[email protected]:~$ cd ~/FlashTool
[email protected]:~/FlashTool$ ./FlashTool
Not running as root but Sony/SonyEriccson Vendor ID found on your udev rules
if Flashing didn't work well, run flashtool as root
No Java in specified path in JAVA_HOME=/usr/lib/jvm/java
Set the variable to a valid Java installation
[email protected]:~/FlashTool$
did u install java?
try installing openjdk. its in official ubuntu repo. oracle java is unsupported anymore.
btw u should logout and relogin back after installing openjk for its path in bashrc to be effective.
jfox22 said:
still nothing I'm doing something wrong but I do not understand what
[email protected]:~$ cd ~/FlashTool
[email protected]:~/FlashTool$ ./FlashTool
Not running as root but Sony/SonyEriccson Vendor ID found on your udev rules
if Flashing didn't work well, run flashtool as root
No Java in specified path in JAVA_HOME=/usr/lib/jvm/java
Set the variable to a valid Java installation
[email protected]:~/FlashTool$
Click to expand...
Click to collapse
Is java installed in "/usr/lib/jvm" ? If yes, then add the path variable /usr/lib/jvm/bin to your bash profile.
flashtool is searching for binary program named "java" in your operating system's path (ubuntu in your case) so you have to edit the path variable in your bash profile or what ever command line interpreter you use to direct it to the "java" binary . Normally java binary and it's associated binaries are present in the bin directory inside your java installation directory so you have to add the path variable which directs the interpreter to look for binaries inside the java's bin directory where java's binaries are present.
Sent from my ST15i using xda app-developers app
I installed openjdk View attachment 1504457
but I have always this View attachment 1504458
Open your home directory and press ctrl+h to see hidden files . Can you see files called .profile and/or .bash_login or files which start with" .bash" ? Tell me what files are present.
Sent from my ST15i using xda app-developers app
what is wrong with the error is that it cant find any java installed in your path.
openjdk should be added to your path automatically if u installed it via apt-get, aptitude or synaptic. and again, after installing openjdk u need to logout and relogin for java path in bashrc to be effective. if still doesn't work even after relogin then try rebooting.
my bet is u doesn't even do the logout and relogin, that why flashtool whines about cannot find java path.
gouthamthemostwanted said:
Open your home directory and press ctrl+h to see hidden files . Can you see files called .profile and/or .bash_login or files which start with" .bash" ? Tell me what files are present.
Sent from my ST15i using xda app-developers app
Click to expand...
Click to collapse
View attachment 1504473
an0nym0us_ said:
what is wrong with the error is that it cant find any java installed in your path.
openjdk should be added to your path automatically if u installed it via apt-get, aptitude or synaptic. and again, after installing openjdk u need to logout and relogin for java path in bashrc to be effective. if still doesn't work even after relogin then try rebooting.
my bet is u doesn't even do the logout and relogin, that why flashtool whines about cannot find java path.
Click to expand...
Click to collapse
I also tried to reboot but nothing.
an0nym0us_ said:
my bet is u doesn't even do the logout and relogin, that why flashtool whines about cannot find java path.
Click to expand...
Click to collapse
That might be the problem but I've edited the path side by side and accessed binaries from terminal (which were not accessible before editing the path) without reboot or relogin.
Sent from my ST15i using xda app-developers app
---------- Post added at 03:21 PM ---------- Previous post was at 03:18 PM ----------
jfox22 said:
View attachment 1504473
Click to expand...
Click to collapse
Open .profile and read the first few lines. Does it say anything about "this profile will not be effective if .bash_login or .bashrc is present" or something like that?
Sent from my ST15i using xda app-developers app
run these in terminal and paste the output here
Code:
sudo update-alternatives --config java
Code:
sudo update-alternatives --config javac
Code:
sudo update-alternatives --config javaw
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"

[HOW TO]Sign Your Apk For Google Play

Hey Guys,
I found it very hard to find this method on the net. I looked for around 12 hours (over a period of 2 days). But here it is!
This method is very helpful if you need to increase the length of your signature on your apk. As Google Play has a minimum length of validity for signatures.
This tutorial contains some knowledge from other websites and some from my own self. Please feel free to use my hard work below. But try to reference me if you can. Thanks!
First of all,
jarsigner and keytool are .exe files that help create your "signed" application for release to the market to prevent fraud.
1.
Make a folder somewhere called "keytools" and make a folder in that called "key"
2. Now move your apk file to the folder keytools.
(Not inside any other folders)
3. Check
"C:\Program Files\Java\jdk1.7.0_11\bin" for jarsigner and keytools..
... or whatever jdk version you have
If you DONT have it install the following: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
4. open cmd.exe,
5. cd your way to where you have your keytools folder...
I had to do.. cd desktop, and to keytools to get to C:\Users\Matt\Desktop\keytools\
In this directory is you apk file which we will manipulate.
Now add the directory C:\"Program Files"\Java\jdk1.7.0_11\bin\ or something like that to PATH in Environment Variables.
Directions on how to do this can be found here: http://www.computerhope.com/issues/ch000549.htm
type the following now (or something similar to my example)
keytool -genkey -alias xda.keystore -keyalg RSA -validity 20000 -keystore keys/xda.keystore
Then you will have be presented with:
Enter keystore password: (type in a password you will use)
Re-enter new password: (type in same password here)
What is your first and last name? Matt <LAST NAME HERE>
What is the name of your Organization unit? (You dont NEED to type anything)
What is the name of your city or locality? <What it says>
What is the name of your state or providence? <What it says>
what is the two-letter country code for this unit? AU
is CN=Matt C=AU.....etc. correct?
[no]: yes (type yes there)
Enter key password for <xda.keystore>
<RETURN if same as keystore password>: (push enter)
6.
To add the directory of jarsigner to the PATH variable just do the steps from here: http://www.computerhope.com/issues/ch000549.htm but with the path of jarsigner. Which should be something like this: echo "PATH=/cygdrive/c/Program\ Files/Java/jdk1.7.0.11/bin:\${PATH}" >> .bash_profile
Now, type the following now (or something similar to my example) NOTE: This is all in cmd.
jarsigner -verbose -keystore key/donate.keystore -signedjar Donate_signed.apk xda.apk xda.keystore
Enter Passphase for keystore: (your password you made earlier)
DO NOT TYPE --> adding: META-INF/MINFEST.MF ....
.......
.....
...Signing: classes.dex <--DO NOT TYPE
and you're all set! you signed your apk file or whatever you wanted to create!
Congratulations.
NOW STOP BEING FRUSTRATED LIKE I WAS FOR HOURS!
Or, if your using Eclipse just right-click your project and choose Android Tools > Export Signed Application Package.. and follow the export wizard.
@M4ttz
Thanks a lot mate!!!!!!!!!
mytheme_signed.apk is created! Let's go to Google Play
EDIT
Google told me that I need to zipalign my apk file.... If I zipalign Google says that my file isn't signed!!!!

Up to Date ADB and Fastboot [Mac]

Welcome
I was trying to unlock the bootloader for my Nexus 6P, but the commands were not working. I had to update the files for adb and fastboot, but it finally worked with the new command "fastboot flashing unlock" . So I have uploaded a zip with the up to date files so you guys can also use adb and fastboot.
If you haven't set up your fastboot/adb here is a quick guide on how to set it up easily.
---Guide---
1. Unzip the file, and copy the adb folder to your preferred destination.
2. Open up terminal and type : nano ~/.bash_profile
3. Use the path of the folder and add this line (replace kingmikel with your username, and replace Documents with your path) : export PATH=${PATH}:/Users/kingmikel/Documents/adb
Credits: @AshtonTS and his thread http://forum.xda-developers.com/showthread.php?t=1917237
Is there some reason to not do this with the SDK?
crachel said:
Is there some reason to not do this with the SDK?
Click to expand...
Click to collapse
This is easier. You don't have to download Java and then download the SDK.

Categories

Resources