So after getting a virus or something on my Windows drive and it not wanting to activate even after having my notebook for 3 years I am migrating over to Ubuntu. I have the android sdk setup and also edited my .bashrc file. Whenever I type adb devices it says
Code:
[email protected]:~$ adb devices
???????????? no permissions
[email protected]:~$ adb shell
error: insufficient permissions for device
What do I do to get it to work?
HELP!!!!!!!!!!!
Try sudo adb devices. You're not running adb as root
Sent from my HERO200 using XDA App
Indeed. You must use sudo.
Code:
[email protected]:~$ sudo adb devices
sudo: adb: command not found
This is what I get.
ah, sorry, try sudo ./adb devices
Try
Code:
cd ~/[COLOR="Sienna"]android_sdk_path[/COLOR]/tools/
su
./adb kill-server
./adb start-server
./adb remount
exit
or you can create a text file with:
Code:
#!/bin/bash
./adb kill-server
./adb start-server
./adb remount
and save it as remount.sh, or whatever you want, and place it in your tools folder then from the terminal cd to your tools folder and
Code:
sudo ./remount.sh
and it should work for you after that. That is what I do whenever I connect my hero
Russss said:
Try
Code:
cd ~/[COLOR="Sienna"]android_sdk_path[/COLOR]/tools/
su
./adb kill-server
./adb start-server
./adb remount
exit
or you can create a text file with:
Code:
#!/bin/bash
./adb kill-server
./adb start-server
./adb remount
and save it as remount.sh, or whatever you want, and place it in your tools folder then from the terminal cd to your tools folder and
Code:
sudo ./remount.sh
and it should work for you after that. That is what I do whenever I connect my hero
Click to expand...
Click to collapse
I'm still having some problems. I can type in kill server, start server, remount and it will work that way. But I can not get the script to work.
unCoRrUpTeD said:
I'm still having some problems. I can type in kill server, start server, remount and it will work that way. But I can not get the script to work.
Click to expand...
Click to collapse
I don't know why it isn't working. I attached the script i'm using (rename to remount.sh).
I just do
cd ~/android/tools/
sudo ./remount.sh
and it works, I don't know why it wouldn't unless the file properties are wrong(ownership,executable) I just started using linux about a month ago (linux mint)
I just installed Ubuntu last week, But I was having problems with my hard drive so I switched it out and loaded Windows and Ubuntu 10.04. I now I have to reload everything I had and I think it might have to do with permssions for the file, but I'm not sure. I am going to try that and also try the script again. Thanks for helping me get it to work at least one way.
i think i may be able to help you with this one
first you need to add the location of the sdk folder to your .bashrc file
open a terminal an enter
Code:
gedit /home/yourusername/.bashrc
replace yourusername with the one you use for ubuntu when the file opens up scroll all the way to the bottom and add this line to the bottom
Code:
export PATH=$PATH:/home/xx/Desktop/android-sdk-linux_86/tools
replace /home/xx/Destop/ with your username and where you have the sdk folder stored so for example, if you have it in your home folder and your user name in ubuntu is jo the string wold be
Code:
export PATH=$PATH:/home/jo/android-sdk-linux_86/tools
save the file, next to get adb to recognize your phone you need to create a udev rules file so open a terminal and enter
Code:
sudo gedit /etc/udev/rules.d/51-android.rules
this will open up a blank text file copy and paste this in it
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
save the file and reboot now when you are back to the desktop you should be able to access your phone through adb.
If you still need help PM me and ill help u out on gtalk or aim
codejunkie78 said:
i think i may be able to help you with this one
first you need to add the location of the sdk folder to your .bashrc file
open a terminal an enter
Code:
gedit /home/yourusername/.bashrc
when the file opens up scroll all the way to the bottom and add this line to the bottom
Code:
export PATH=${PATH}:/home/xx/Desktop/android-sdk-linux_86/tools
replace /home/xx/Destop/ with your username and where you have the sdk folder stored so for example, if you have it in your home folder and your user name in ubuntu is jo the string wold be
Code:
export PATH=${PATH}:/home/jo/android-sdk-linux_86/tools
save the file, next to get adb to recognize your phone you need to create a udev rules file so open a terminal and enter
Code:
sudo gedit /etc/udev/rules.d/51-android.rules
this will open up a blank text file copy and paste this in it
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
save the file and reboot now when you are back to the desktop you should be able to access your phone through adb.
Click to expand...
Click to collapse
Thanks. I had everything else setup. All I was missing was the udev rules. It works now. Just looked in the Wiki and the answer was there all along. i must have missed it before.
unCoRrUpTeD said:
Thanks. I had everything else setup. All I was missing was the udev rules. It works now. Just looked in the Wiki and the answer was there all along. i must have missed it before.
Click to expand...
Click to collapse
happy to help!
ok so i am having some of the same problem but i am trying to build a kernel using ubuntu 10.04 and so far eveything was going goo until i had to enter the command adb push config...........and i get comand adb does not exsist and it gives me a list of commands that work. But I need to use adb because of the android and i have tried just about eveything on this forum and i am not getting anything to work. Its wired i was able to root my phone and it had adb commands but when building a kernel it wont work can someone please help me i really wanna try and bulid my own kernel/rom to my likings instead of downloading a bunch of different ones. CAN SOMEONE PLEASE PLEASE HELP
krysalicea said:
ok so i am having some of the same problem but i am trying to build a kernel using ubuntu 10.04 and so far eveything was going goo until i had to enter the command adb push config...........and i get comand adb does not exsist and it gives me a list of commands that work. But I need to use adb because of the android and i have tried just about eveything on this forum and i am not getting anything to work. Its wired i was able to root my phone and it had adb commands but when building a kernel it wont work can someone please help me i really wanna try and bulid my own kernel/rom to my likings instead of downloading a bunch of different ones. CAN SOMEONE PLEASE PLEASE HELP
Click to expand...
Click to collapse
To edit a kernel you will need to get the boot.img either from your phone or from a nandroid.
THIS will give you everything
Related
ok so I got adb working fine .. but apparently I have NO idea on how to properly pull and anything from the phone or push to the phone what I saw was something about adb pull system/sd/app app and then I have seen adb pull system/sd/app/app which BOTH give me the adb: not found
then I have created a folder named android on my C:
then I tried the cd C:\android adb pull /system/sd/app/app and that gives me a bad substitution
I have also tried the adb pull system/sd/app/app cd C:\android .. this also gives me that bad substitution error
so what I NEED is SOMEONE to give me SPECIFIC examples of this
so i am asking for 2 exapmles
one to pull the calcultor from the phone to the comp
second is to pull an installed app like chompsms from the phone to the comp
I am doing all of this from the #
I have searched google and cannot find ANYTTING on this
I have searched here and found nothing
I have read the adb for dummies and the adb useful commands
any help on this would be great
also I have done the cd data then cd app and then when I get to the cd ls is says cannot cd into ls
But when I just ls I get the apps list
I am using vista 64 too
BTW I am using the 1.5MOD from lucid and I do have my apps to the sd card by using his lucid script
Strapt said:
BOTH give me the adb: not found
Click to expand...
Click to collapse
Put the path to your folder with adb in it in your system path directory. Instructions from the android dev site:
Optionally, you may want to add the location of the SDK's primary tools directory to your system PATH. The primary tools/ directory is located at the root of the SDK folder. Adding tools to your path lets you run Android Debug Bridge (adb) and the other command line tools without needing to supply the full path to the tools directory.
On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ directory to it. If you don't see a line setting the path, you can add one:
export PATH=${PATH}:<your_sdk_dir>/tools
On a Mac, look in your home directory for .bash_profile and proceed as for Linux. You can create the .bash_profile if you haven't already set one up on your machine.
On Windows, right-click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path (under System Variables). Add the full path to the tools/ directory to the path.
Click to expand...
Click to collapse
then I have created a folder named android on my C:
then I tried the cd C:\android adb pull /system/sd/app/app and that gives me a bad substitution
Click to expand...
Click to collapse
Adb push/pull requires two arguments, the source and the destination. E.g. on windows:
adb push \completely_legit_apps\gamelofd-monopolizing.apk /data/app/mono.apk
-or-
adb pull /system/app/Mail.apk \roflmao_i_ripped_exchangemail.apk
Notice that on the Android side, the path delimiter is the forward slash (/), whereas on the Windows side it's backslash (\).
Edit: also, on windows if you don't specify an absolute path, it is taken as being relative to your usr directory:
adb push \app.apk <-- pushes c:\Documents and Settings\username\app.apk, NOT c:\app.apk
^above^
But this is also in the wrong forum! This belongs to Q&A.
jashsu said:
Put the path to your folder with adb in it in your system path directory. Instructions from the android dev site:
Adb push/pull requires two arguments, the source and the destination. E.g. on windows:
adb push \completely_legit_apps\gamelofd-monopolizing.apk /data/app/mono.apk
-or-
adb pull /system/app/Mail.apk \roflmao_i_ripped_exchangemail.apk
Notice that on the Android side, the path delimiter is the forward slash (/), whereas on the Windows side it's backslash (\).
Edit: also, on windows if you don't specify an absolute path, it is taken as being relative to your usr directory:
adb push \app.apk <-- pushes c:\Documents and Settings\username\app.apk, NOT c:\app.apk
Click to expand...
Click to collapse
ok so I am trying to pull the Mms.apk to the comp into my C: documents
So I got
# adb pull /system/app/Mms.apk ... then what exactly would I need to finish the rest? how would that look whole?
My Mms.apk is in system/app in my phone and I do have apps to sd if that makes a diff
also .. if I pull this does that completely remove it from the phone? assuming it would
I keep getting adb not found But I can type lucid and it shows the lucid comands and reboot and it reboots ... so i am connected ...
Strapt said:
ok so I am trying to pull the Mms.apk to the comp into my C: documents
So I got
# adb pull /system/app/Mms.apk ... then what exactly would I need to finish the rest? how would that look whole?
My Mms.apk is in system/app in my phone and I do have apps to sd if that makes a diff
also .. if I pull this does that completely remove it from the phone? assuming it would
I keep getting adb not found But I can type lucid and it shows the lucid comands and reboot and it reboots ... so i am connected ...
Click to expand...
Click to collapse
adb pull /system/app/Mms.apk temp/
Of course, you can substitute temp with any folder you want (by default, you will save it under the folder that adb is located in,
so the command above would push the file to /adb directory/temp
Like that.
Its might be saying that its not there, because its not there, with apps2sd it should be located under /system/sd/app_s/Mms.apk (but of course this differs from build to build)
and no, I don't think it will remove it, it should still be there, to remove it you have to type:
adb shell rm /system/sd/app_s/Mms.apk
h.nocturna said:
adb pull /system/app/Mms.apk temp/
Like that.
Its might be saying that its not there, because its not there, with apps2sd it should be located under /system/sd/app_s/Mms.apk (but of course this differs from build to build)
and no, I don't think it will remove it, it should still be there, to remove it you have to type:
adb shell rm /system/sd/app_s/Mms.apk
Click to expand...
Click to collapse
ok so I tried both the
/system/app/Mms.apk temp/
and the adb pull /system/sd/app_s/Mms.apk temp/
BOTH I get adb not found
Do i need to add something like cd C:\Documents adb pull /system/app/Mms.apk ??? (which If I do that I get a bad substitution error or a directory not found .. which it is in there)
when I go thru astro the path is system/app then I see all the stock apps and the odex files
EDIT: some I have seen have been adb pull /system/app/Mms.apk/Mms.apk OR adb pull /system/app/Mms.apk Mms.apk .. those I still get adb not found
EDIT EDIT: hell even adb remount gets me adb not found ... and the cd ls gets me cant cd into ls
EDIT EDIT EDIT: ok so i tried to change the dir to where the file goes. So I created a Documents folder in root of my C drive. Then I used the adb pull /system/app/Mms.apk Documents\ and I got a > and nothing is in my folder I changed the direction of the last \ after Documents
I got it!!! this worked!!!
adb pull /system/app/Mms.apk \Documents WORKS!!! NOT FROM THE#!!!
Strapt said:
I got it!!! this worked!!!
adb pull /system/app/Mms.apk \Documents WORKS!!! NOT FROM THE#!!!
Click to expand...
Click to collapse
I think you should learn more about command prompts and linux shell commands
other than that, good for you.
glad it worked for you. If i wasn't clear, I meant that you should've cd to the location of adb on your computer through command prompt, then from there run the commands that I outlined above.
h.nocturna said:
glad it worked for you. If i wasn't clear, I meant that you should've cd to the location of adb on your computer through command prompt, then from there run the commands that I outlined above.
Click to expand...
Click to collapse
ok so like what ya mean?
from the
C:\Users\Owner
I do then "cd C:\android-sdk-windows-1.5_r2\tools"
and that takes me to the plain C:\android-sdk-windows-1.5_r2\tools
so from here what would you type in to cd and cd into what?
apparently the problem what that I typed adb shell and then was doing everything from the comand prompt and that didnt work.
ok so I think I figured out what you mean.
I did type the cd C:\Documents then I get the C:\Documents> and from there I can run just the adb pull /system/app/Mms.apk Mms.apk
now that I have that working I have to try the push now
so with the same example above I would:
again cd C:\Documents
then
adb push Mms.apk /system/app/
is that right or should that be different?
ok so here is a question
I did mange to find where my downloaded apps are going by mounting the volumes onto ubuntu. which is /media/disk-1/app and this is in my ext2 partition
but I cant seem to be able cd to the /media/disk-1/app everytime it says cant cd to /media/disk-1/app
trying to do two things
one is trying to cd into that path so I can ls
and also trying to see how I would be able to pull apps that I have downloaded
I have kinda figured out the other pull but now would like to know why this isnt working.
Strapt said:
ok so I think I figured out what you mean.
I did type the cd C:\Documents then I get the C:\Documents> and from there I can run just the adb pull /system/app/Mms.apk Mms.apk
now that I have that working I have to try the push now
so with the same example above I would:
again cd C:\Documents
then
adb push Mms.apk /system/app/
is that right or should that be different?
Click to expand...
Click to collapse
adb should only work from whatever location you put the adb.exe, so for instance, I'm assuming that you put adb in c:\Documents. Then you would type cd c:\documents and run your adb commands there, and adb will treat c:\Documents as your root folder (which is why everything transfers to c:\Documents by default for you). Therefore, the push commands will also treat c:\Documents as your root folder, so you can only push whatever is in c:\Documents. So transfer whatever file you want to be pushed to c:\Documents and then adb push file within c:\Documents /wherever you want it on the phone
h.nocturna said:
adb should only work from whatever location you put the adb.exe, so for instance, I'm assuming that you put adb in c:\Documents. Then you would type cd c:\documents and run your adb commands there, and adb will treat c:\Documents as your root folder (which is why everything transfers to c:\Documents by default for you). Therefore, the push commands will also treat c:\Documents as your root folder, so you can only push whatever is in c:\Documents. So transfer whatever file you want to be pushed to c:\Documents and then adb push file within c:\Documents /wherever you want it on the phone
Click to expand...
Click to collapse
well actually I made the Documents folder and its completely empty
the actual adb.exe is in the C:\android-sdk-windows-1.5_r2\tools\adb.exe
I think that I have copied and pasted that and some win something .dll into system32 folder. not sure if that makes a difference or not.
from my understanding I can now change it to whatever folder I want to move the files to on my comp just by typing the location and folder name and not just to the Documents folder.
also when I am at the C:\android-sdk-windows-1.5_r2 in cmd what is that line called or the commands that you do from that line called? and the pull push has to be from this line right?
Im guessing that the adb shell is the linux shell commands which is the # right?
also I would to really like to say thank you for your continued help on this!!
Its no problem, placing it in system32, allows you to use adb.exe straight from the console so its alright. But instead of cd(ing?) to whatever location the adb.exe is located, just cd to wherever you want to pull the files or wherever the files you want to push are and then just run the commands outlined above for pushing/pulling files.
the # denotes that you have entered the phone's terminal with root permissions. Yes, it is linux.
Yes the commands must be typed from the command prompt so:
C:\Documents>adb pull /system/sd/app_s/Mms.apk C:\Documents
or wherever you want, just replace C:\Documents with whatever you want.
I am trying to get ADB by following
http://forum.xda-developers.com/showthread.php?t=532719
and i have done everything up until the cmd command part.
when i open my cmd, it already has
C:\users\jessie>
how can i get rid of that so i can enter in the information properly?
thank you
use the change directory command
cd C:\Android\ or wherever you want to change directories to
How do you change it?
I assume you're trying to do this part:
Code:
cd C:\android-sdk-windows-1.5_r2\tools === Press Enter
adb devices === You should see your device listed
adb shell === you should see # in the next line
Right?
C:\users\jessie> is your command prompt. Just type right there. You'll see something like this--
Code:
C:\users\jessie>cd C:\android-sdk-windows-1.5_r2\tools
C:\android-sdk-windows-1.5_r2\tools>adb devices
C:\android-sdk-windows-1.5_r2\tools>adb shell
#
Hope that helps.
shockaj said:
How do you change it?
Click to expand...
Click to collapse
Or if you copy the adb.exe, fastboot.exe, and that dll file they included to c:/windows/system32/ and then restart you can use adb and fastboot regardless of what directory you happen to be in.
ah yes i found the problem i had install version 1.1 and was using the path for 1.5
thank you for your help
Glad it worked out =] Please change the thread title to [SOLVED]
I have been trying to make this whole adb think work for about twenty hours strait and I still have not gotten very far. I own a mac and no pc and updated to froyo with my buddies pc. I have followed all the directions to a T over and over using terminal on the mac and I can get to the ADB commands and even to where I can see my phone by clicking devices but I must be missing something important. ANY HELP WOULD BE REALLY APPRECIATED I AM ABOUT TO PULL MY FREAKING HAIR OUT!!!
Ok, so if you can see your phone through adb, then you are definitely on the right track. Unfortunately, I'm not really familiar with OS X anymore so I'm not quite sure how to do it. Just sit tight for now until someone who does use a Mac, or has more of a clue then I do can help you out.
But seriously, don't pull your hair out. It won't stay on your head forever ya know...
Edit: oops, just saw this is JI6 (Froyo) not JF6, so I can't help you, but here is a general overview:
from terminal inside Android sdk main directory:
tools/adb devices -> list all devices connected that ADB can see
tools/adb shell -> gets a normal user shell on your phone
tools/adb reboot recovery -> reboots into recovery mode, suitable for update.zip root method
--------------------------------
Place the root update.zip on internal sdcard.
from terminal inside Android sdk directory:
tools/adb reboot recovery
Select the update software option, and you will be done.
laxwillsch said:
I have been trying to make this whole adb think work for about twenty hours strait and I still have not gotten very far. I own a mac and no pc and updated to froyo with my buddies pc. I have followed all the directions to a T over and over using terminal on the mac and I can get to the ADB commands and even to where I can see my phone by clicking devices but I must be missing something important. ANY HELP WOULD BE REALLY APPRECIATED I AM ABOUT TO PULL MY FREAKING HAIR OUT!!!
Click to expand...
Click to collapse
Start simple:
If you open a terminal on the mac, and go to your android SDK tools folder; what happens when you type ADB shell?
Or if you type any of the ADB push commands?
You need to give more detail around what you are seeing for us to help you.
Ok so if I am in terminal and i type in my /android-sdk-mac_x86/tools nothing happens and it just says /android-sdk-mac_x86/tools is a directory. But if I type the same but with /tools/abd it opens the abd command lines, like how to write code. Then when I try to "adb push rageagainstthecage-arm5.bin /data/local/tmp/rageagainstthecage-arm5.bin"
it says "-bash: adb: command not found"
however when I type laxwillsch$ /android-sdk-mac_x86/tools/adb shell
it does give me the drop down $
but when I then try to write the next line of code "chmod 0755 rageagainstthecage-arm5.bin"
it says "chmod: rageagainstthecage-arm5.bin: No such file or directory"
I am stumped I am beginning to think i need to buy a pc as I am very interested in android development and want to learn more, but it seems all the tutorials are run assuming you are on a PC
EDIT** I have downloaded the android SDK started pack, and the 2.2 root pack and they are all in my /android-sdk-mac_x86/tools folder that is directly on my Macintosh HD for simplicity
Do you know how to change directories (cd command)?
The problem is that you are trying to work in one directory, but all your tools are in another.
So change directories to the tools directory:
cd /android-sdk-mac_x86/tools/
now run your adb commands - you may have to type ./adb to tell your mac to look in the current directory for the adb command (that is what ./ means "start here")
Also, try to understand what is happening so you can more easily troubleshoot: chmod is a command to change permissions, and you are running it on the phone. If you can't push the file to the phone, then you can change it's permisssions. I guess you never got rageagainstthecage on the phone, so there is no way to chmod it.
If you can't do this on a mac, a PC is not easier. I use both, and like both, but you need to learn basic commands first - they apply to the mac terminal and the windows cmd prompt.
Getting root means moving in and out of the phone - adb shell - puts you in a terminal on the phone. So you really need to understand cd (change directory); pwd (present working directory - shows you where you are); cp (copy); and know your current path - what the ./ does.
I hope this helps, not trying to sound condescending - maybe practice a linux terminal tutorial would help
Thanks so much, I am at school right now and cant test out all that but you are really helping me understand all this! I will post tonight and let you know how it goes. again thank you
ok so i dont have my usb cable with me but I was playing around with the commands that you suggested and ureka! i finally got to a point where it says "h70-33-65-19:tools laxwillsch$" thats a first! and when i type pwd it shows "/android-sdk-mac_x86/tools" so that means I am working out of the right directory right? and from here I enable usb debugging connect my phone then just copy and paste the codes from the thread correct?
yes, it sounds like you are on the right track. But take it nice and slow when you follow the steps. It is very important that the commands are entered exactly as you see them.
Also, one step tells you to wait for something to run and kick you out of ADB - wait just like it says - takes about 45 seconds but feels like forever.
If you are in the tools directory - just by typing "adb" no quotes will give you whole page of adb commands - if you get a "command not found", then you need to add the ./ and make it ./adb
Hope this helps and again, read the commands step by step a couple times first so you understand what is happening.
In a nutsell, you push the rage file;
change its permissions, run it;
get kicked out of ADB and then open a new ADB shell;
you are now root;
remount the system partition to give you write access when it reboots;
reboot;
push over some files;
change permissions on files you pushed;
reboot;
Some things to know - SU is a command for gaining root access; when you use SU your prompt changes (in adb shell) from $ to #
If you are succesful you should see the SuperUser app listed in your apps.
Done and Done just rooted successfully couldnt have done it without you! thanks so much
I followed all of these instructions. Link: Here
But when I try to navigate to AndroidSDK folder in my home directory I can't get adb shell to start.
Code:
cd ~/AndroidSDK/tools
adb shell
After that the terminal says command not found and stuff.....anyone know how to set up adb shell on linux? (I'm running linux mint 10 specifically but I am a experienced linux user, i've used ubuntu and linux mint 10, so if you give me ubuntu commands for fixing this i can convert them into linux mint commands if need be).
Thanks for helping me get this set up on linux. I've mainly been a windows user and as easy as it would be for me to dual boot into windows instead i'm trying to make linux my main operating system slowly b/c i'm liking this operating system more than windows 7. so before i do that I want to make sure i know how to complete all the task i would want to do on windows 7 on linux instead, starting with adb shell
Those instructions are for an earlier version of android SDK. I am sure you downloaded and installed the latest from google's official website. If so, the adb command has moved to a different folder - platform-tools.
Do a search in the android sdk folder for "adb.exe", you should be able to find it and then use that folder as your base adb folder. Alternatively, you can setup the folder to be part of the path, that way you can execute adb from anywhere. If you need help, let me know.
andythegreenguy said:
Those instructions are for an earlier version of android SDK. I am sure you downloaded and installed the latest from google's official website. If so, the adb command has moved to a different folder - platform-tools.
Do a search in the android sdk folder for "adb.exe", you should be able to find it and then use that folder as your base adb folder. Alternatively, you can setup the folder to be part of the path, that way you can execute adb from anywhere. If you need help, let me know.
Click to expand...
Click to collapse
Can you give me full instructions on how to set up adb using the latest android sdk from google? Thanks
Sent from my DROIDX using XDA App
kifno said:
Can you give me full instructions on how to set up adb using the latest android sdk from google? Thanks
Sent from my DROIDX using XDA App
Click to expand...
Click to collapse
What I found when setting up mine on linux was to start adb, navigate to the tools directory where you have it setup, and use the command "./adb shell" minus the quotes. This seems to work fine, I don't know why. I beat my head against the wall, and don't remember how I found out about this. It's safe to say, the ./adb should need to be used with all the adb commands.
Kifno check the dev section for my thread on how to install adb on Ubuntu should help you out. It might be buried but I posted a full guide.
Edit---- If you look on my thread on how to indtall adb in windows. On the bottom of the post its a link to my other thread..
Yea it's me Again. With the
Modified .HERO.
Step-by-step guide to setting up android sdk on linux:
1. On your linux box, go to http://developer.android.com/sdk/index.html and download the package for linux
2. Create a "androidsdk" folder in your home folder
3. Unzip the contents of the "android-sdk-linux_x86" from inside the tgz file - into the above folder. You should have "add-ons", "platforms", "tools" and "SDK-readme.txt" in the above folder
4. Open a terminal window and navigate to androidsdk -> tools directory
5. Execute command "android" without quotes - this should open a UI
6. Go to available packages and install all packages you need
7. Once it has installed everything, exit the application
8. Navigate to your androidsdk/platform-tools directory - you should have adb there.
Now you can run adb from here or setup your computer to run from anywhere - following steps are to setup so that you can run adb from anywhere...
1. Append the following code in your .profile file - replacing "full path to your platform-tools directory" with the actual path with quotes:
if [ -d "full path to your platform-tools directory" ] ; then
PATH="full path to your platform-tools directory:$PATH"
fi
2. Save your .profile
3. Logout and log back in.
Now you should be able to execute adb from anywhere on the linux box, when you login using your credentials.
andythegreenguy said:
Now you can run adb from here or setup your computer to run from anywhere - following steps are to setup so that you can run adb from anywhere...
1. Append the following code in your .profile file - replacing "full path to your platform-tools directory" with the actual path with quotes:
if [ -d "full path to your platform-tools directory" ] ; then
PATH="full path to your platform-tools directory:$PATH"
fi
2. Save your .profile
3. Logout and log back in.
Now you should be able to execute adb from anywhere on the linux box, when you login using your credentials.
Click to expand...
Click to collapse
the bold is where i'm having trouble....where is the .profile file located?
also would this be the correct full path leading to platform tools? (so i can know when i get ready to do the .profile file thingy once you explain that)
~/AndroidSDK/platform-tools
btw thanks for the help (clicking thanks button.....lol)
edit: i also just got this problem
Code:
kevin-Satellite-L305 platform-tools # ./adb shell
error: insufficient permissions for device
it won't let me launch adb shell even after i typed su and put in my password
.profile is in your home directory. You can get to your home directory from anywhere in linux by typing "cd $HOME" at the shell prompt without quotes and as is here. If you know of DOS, you can relate to a .profile file as an autoexec.bat, that executes everytime a user logs in.
You need the absolute path to the platform-tools folder - which you can get by being in that folder and typing "pwd" without quotes.
The last error, it has something to do with your computer OS not recognizing your device.
1. Go to /etc/udev/rules.d
2. Look for a file 99-android.rules - if one does not exist, create one
3. Append the following line to the file: SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", OWNER="linux user name" GROUP="linux user group", replacing linux user name and linux user group with the actual values.
4. Save the file and restart your computer
This should do it.
ADB:-
Android Debug Bridge
Very useful program made itself by Google for Programmers and developers. Its based on command line and basically communicates with your Android to respond to certain commands. There is vast amount of knowledge about adb but its most useful commands limit to getting:-
Logcat:-
A real time log of what is happening in background of our devices. It is really useful for developers to see which component has malfunctioned and helps to narrow down their search for what failed and what needs to be fixed. Several times users are asked to give logcats of their devices which are giving errors. We will go in detail that how to get logcats in every and easiest way possible.
App Installation and Management:-
adb proves really handy if you want to install apks directly from your PC or want to batch install or delete them.
Shell Execution:-
You must have heard of Terminal Emulator. It is an app for android to execute shell commands(linux commands) which are basically present as applets in /system/bin, /system/sbin or /system/xbin(in our case) folders. A very imporant applet called busybox is installed there mainly used for execution of basic commands during root browsing or ROM installation. Many times updater script of ROMs use busybox commands to install it. Well, these commands can be initiated from your device too but they can be initiated from adb also making it easy for programmers.
Pushing and Pulling:-
Most used commands of adb. adb makes it a piece of cake for new device developers to get an ideo of structure and basic knowledge of devices by pulling command. We can pull out i.e copy any files or folders from our devices to our PC, even the root directories without rooting the devices. It help rooters and ROM chefs of new devices to get an idea and implement their mods on them. Pushing is also very useful command. It copies your files and folders from PC to your device. Very useful in pushing some /system apps and other things
Remounting and setting permissions
Basic commands:-
Of-course basic commands such as rebooting and rebooting in recovery mode and download mode are supported.
Others:-
There are several other features of adb such as fastboot, aapt, etc
Setting up ADB
Pre Requirements:-
PC(This is a windows guide, if asked I will add linux and mac guide later)
Java Runtime environment or Java Developing kit
Your Device Drivers
An Android Device
USB Debugging MUST be turned ON in the device for ADB to see it & Developer options is hidden in Android 4.2 and
above, Hitting Build number 10 times in
About Phone/Tablet reveals the menu (Thanks lilHermit for reminding me to add it)
Assuming you all these ready and working properly, we continue
If you are having trouble completing Pre-Requisites, there are several guides featuring them too
Start
1. First Download Android SDK. Roughly about 70 MB
2. There may be any compressed zip file or exe file
If zip file, then extract it to C:\android-sdk
If exe file then double click on it and install it in C:\ Drive(or any other drive you want)
3. Now to get adb and other tools, you need to download 'Platform Tools'
To download them, go to the android-sdk folder and double click on SDK Manager
It will ask you which package to download? However, it is your choice which package to Download, but here, we will only talk about platform
Tools. So, simply tick on Platform Tools and click on install. Once you have done it. Go to the platform-tools folder in the directory where you installed android-sdk. You will find several files there like adb, fastboot, aapt, etc
4. Now, you can backup the whole folder of android-sdk to any external storage that will make you not download package
again if you want to. You can have it placed in any computer and run it as it does not require registry to work
5. Now, you are just one step away from using adb. Next step is SKIPPING SETTING ENVIRONMENT VARIABLE (If you however want to set environment variables. Click on Show Content)
We can easily append the sdk platform-tools and tools folder to your systems environmental path variable directly from command line(cmd) by simply issuing one command and performing a system reboot:
Code:
[COLOR=Black]SETX PATH "%PATH%;[/COLOR][COLOR=Indigo]SDK_Install_Path[/COLOR][COLOR=Black]\platform-tools;[/COLOR][COLOR=Indigo]SDK_Install_Path[/COLOR][COLOR=Black]\android-sdk-windows\tools" -m[/COLOR]
Just replace the "SDK_Install_Path" in the above with the proper path of your SDK installation. Example: C:\android-sdk-windows
(Thanks to WugFresh for telling me :victory
Many guides on internet say that it is to be done for making it easy for users and if you have some basic knowledge of Command Prompt,
you will know that to execute any application with command prompt, you first need to change the directory to the one where application is
placed. And to skip changing the directories every time you open CMD, you need to put that application is environment variable. However, we will not do so.
6. Type cmd in the search bar. Copy cmd.exe from there. Go to the directory where you have installed android-sdk. Go to platform-tools folder. Paste cmd there, right click on it and in the settings, select Run as Administrator.
7. You are done. Now what to do in it?
ADB Commands
Type adb in command prompt. And several commands will show up on your screen. It is very difficult to analyse these all commands, so we will only talk about most used and important commands
Connect your device via USB cable
And open the CMD in platform-tools folder(Make a shortcut of it on desktop). And type the suitable commands
Code:
adb devices
Will show the list of devices attached to the PC andtheir serial numbers. If this shows up correctly on your PC, then it means that everything is fine for continuing.
Logcat
Code:
adb logcat
It will display the real time log of your device
Best time to do it is when your device boots up
Now, many users ask me how to copy the logcat and upload it from CMD
There are several methods:-
1. Right click on the Title Bar of Command Prompt. Hover the cursor over edit and select mark. Select all the things you want to copy and then click enter. All the things will be copied to clipboard.
2. This is the correct way of getting logcat saved.
Code:
adb logcat > logcat.txt
This command will create a logcat.txt document in platform-tools folder with the complete logcat of the device. Ofcourse you can type any name instead of logcat.txt
3. I prefer taking logcat this way as it neatly compiles logs of different time
Code:
adb logcat -v long > logcat.txt
This is a very nice way to get logcat.
Installing Apps
Code:
adb install %PATH OF APK%
This will install an app on your Android
For example, if my app AreeB.apk is in G:\ drive (G:\AreeB.apk)
Then I will type
Code:
adb install G:\AreeB.apk
Be sure your apk is not in a folder that has space in its name, else the command will break at space bar.
For eg:-
G:\Program Files\AreeB.apk
Note:
If you have spaces in path of apk, you can execute the command without breakage if you include the path inside quotes. (Thanks to etcman)
Eg:-
Code:
adb install "G:\Program Files\AreeB.apk"
Mounting
However, I never found any problem in tweaking with system files with adb, but some users said that they couldn't do it, so the problem was that their system partition was mounted as Read Only(R/O)
So, it is necessary now to tell how to mount system partition as Read Write(R/W)
Code:
adb remount
It is easiest way to do so, if it does not work then
There is another method that we will discuss in ADB Shell commands section
Pushing and Pulling
For pushing,
Type
Code:
adb push %PATH TO BE PUSHED% %PATH WHERE TO BE PUSHED%
Suppose I have an app named SystemUI.apk(PATH = G:\SystemUI.apk) which I want to push in /system/app/ on my android(or in other words, install an app as a system app). Then I would type
Code:
adb push G:\SystemUI.apk /system/app/
More examples
G:\Dance.txt file to be pushed in Dance folder in sdcard
Code:
adb push G:\Dance.txt /sdcard/Dance/
OR
Code:
adb push G:\Dance.txt /mnt/sdcard/Dance/
G:\Movies folder to be transferred in SDCARD in Videos Folder
Code:
adb push G:\Movies /sdcard/Videos/
G:\system\framework\framework-res.apk to be pushed in /system/framework/
Code:
adb push G:\system\framework\framework-res.apk /system/framework/
For pulling,
push command replaces with pull and paths are swapped
Code:
adb pull %PATH TO BE PULLED FROM% %PATH TO PLACE PULLED FILE%
Example,
All system apps are to be pulled to G:\ROM\system\app
Code:
adb pull /system/app G:\ROM\system\app\
build.prop to be extracted to desktop
Code:
adb pull /system/build.prop C:\Users\Areeb\Desktop\
However, if a folder is in platform-tools folder, you don't need to type full path
Suppose if I type
Code:
adb pull /system/ system
Then a folder named system will be created inside platform-tools with all the files in system in it
If a file is in platform-tools folder, then also no need to type full path
For example,
There is an app name DeskClock.apk in this folder then, to push it to /system/app, type
Code:
adb push DeskClock.apk /system/app/
ADB Shell Commands
This mode of adb allows you to execute linux shell commands from your PC
These commands can aldo be executed through the mobile using Terminal Emulator
To initiate shell mode
Type
Code:
adb shell
You will get an prompt like this
sh-3.2#
Now you are in shell mode
adb commands won't work here and a new set of commands will work here. But we will only go in a little detail here.
Assuming you are in adb shell mode, I will only type commands that will work on shell. Note:- These commands won't work if you type them alone on cmd. But, these command will directly work on your mobile's Terminal Emulator
As these commands can also work on mobile, I am going to tell you a way of taking logcat on mobile
Type
Code:
logcat
You will see log of your device
To save this
Type
Code:
logcat > /sdcard/log.txt
A file named log.txt will be generated in sdcard
Uninstalling Applications
Code:
cd /data/app
This will change the directory to /data/app
Code:
ls
This will show the list of files in there
Suppose, there is an app named com.opera.browser (Opera Mobile) you want to uninstall it
Type
Code:
rm -r com.opera.browser
This will uninstall the app
Mounting Command:-
Code:
mount -o rw,remount /dev/block/mtdblock3 /system
Miscellanous commands:-
su: Initiates root request
du: Shows file foldrs and size
date: Shows todays date
ls: Shows list of directory
cd: Changes working directory
rm: Removes the file
logcat: Displays logcat
mount: Mounts the partition
busybox: Busybox Applets
Credits
Google: For Android and several searchings
Samsung: For Galaxy Ace s5830I
paxChristos for amazing logcat guide
Broadcom: For their Open Sourceness
XDA Forums : For the precious knowledge
Reserved
Reserved Once More
Last One
Reserve the guide
install full rom
how to install a full rom from adb?
Pretty sure it's impossible. Sorry.
Sent from my E15i using XDA Premium App
Perfect Guide to use ADB Commands..
It is very clear and perfect guide to use ADB commands.. I tested this all and works fine..
You can use apks to do logcats from the phone too, I use catlog.
About Broadcom being open sourced made me laugh hahaha.
open source broadcomm, i see what you did there .
Updated OP
Hey, I have downloaded adb a week ago. I did everything like your tutorial and more but adb doesn't see my device. I already have USB Debugging on and have the USB Drivers, but it doesn't work. This is what I get (Screenshot)
Android-fany said:
Hey, I have downloaded adb a week ago. I did everything like your tutorial and more but adb doesn't see my device. I already have USB Debugging on and have the USB Drivers, but it doesn't work. This is what I get (Screenshot)
Click to expand...
Click to collapse
Probably because of bad drivers
Can you use any other software with your mob
Because when I had this problem, reinstalling drivers fixed it.
iamareebjamal said:
Probably because of bad drivers
Can you use any other software with your mob
Because when I had this problem, reinstalling drivers fixed it.
Click to expand...
Click to collapse
I already reinstalled it like 5 times. Still doesn't work.
Android-fany said:
I already reinstalled it like 5 times. Still doesn't work.
Click to expand...
Click to collapse
Which Windows?
Which ROM?
iamareebjamal said:
Which Windows?
Which ROM?
Click to expand...
Click to collapse
Windows Vista
Stock Rom + Interactive Kernel (If the kernel is important too)
Android-fany said:
Windows Vista
Stock Rom + Interactive Kernel (If the kernel is important too)
Click to expand...
Click to collapse
Ah Vista
That old Nemesis
Frankly telling you bro, Vista sucks big time
I unistalled it as soon as I found out that Android kitchen won't work on it
Sorry bro
I don't know much about Vista
Install 7 or 8
AW: [GUIDE][ADB]Easiest How to use adb, logcat, etc for noobs and newbies
iamareebjamal said:
Ah Vista
That old Nemesis
Frankly telling you bro, Vista sucks big time
I unistalled it as soon as I found out that Android kitchen won't work on it
Sorry bro
I don't know much about Vista
Install 7 or 8
Click to expand...
Click to collapse
I can't install Windows 7/8 because it is not my computer.
But Android Kitchen and the other tools works. Just not adb.
Tapatalked by s5830i
Android-fany said:
I can't install Windows 7/8 because it is not my computer.
But Android Kitchen and the other tools works. Just not adb.
Tapatalked by s5830i
Click to expand...
Click to collapse
Very strange
Download My Phone Explorer and check if its working!!
Its just 2mb-6mb