Can anyone help me on understanding ADB commands? - Android Q&A, Help & Troubleshooting

Hey all I hope I'm not in the wrong section and I tried searching for an already similar if not identical thread but couldn't find one(probably not looking too hard) but I have a rooted LG G2 and I have ADB up and running but I don't know the commands I'm assuming. I type "ADB shell" and it connects and finds device but the only command that works for me is "reboot system". I've tried "boot recovery" and a few iterations but no luck.. Do I just not know the correct commands to tell it?
Sent from my LG-D801

DurbanPoison24 said:
Hey all I hope I'm not in the wrong section and I tried searching for an already similar if not identical thread but couldn't find one(probably not looking too hard) but I have a rooted LG G2 and I have ADB up and running but I don't know the commands I'm assuming. I type "ADB shell" and it connects and finds device but the only command that works for me is "reboot system". I've tried "boot recovery" and a few iterations but no luck.. Do I just not know the correct commands to tell it?
Sent from my LG-D801
Click to expand...
Click to collapse
It would help if you told us what it is you're trying to do. If you just want a full list of every command then there's threads and websites that have it all. If you're trying to do something specific then let us know and we'll try and give you the correct commands.
The most common you'll use are:
adb devices - To ensure phone is connected correctly.
adb shell - To access the phone shell (?).
adb push [filename] /path/to/destination - Send a file from PC to phone, usually the sdcard.

Mr_JMM said:
It would help if you told us what it is you're trying to do. If you just want a full list of every command then there's threads and websites that have it all. If you're trying to do something specific then let us know and we'll try and give you the correct commands.
The most common you'll use are:
adb devices - To ensure phone is connected correctly.
adb shell - To access the phone shell (?).
adb push [filename] /path/to/destination - Send a file from PC to phone, usually the sdcard.
Click to expand...
Click to collapse
If it makes any sense I really wasn't trying to do anything specific I just wanted to make sure everything was working right. And as for what wasn't working for me was telling the phone to go into recovery. That's honestly the only thing I was trying.
Sent from my LG-D801 using xda app-developers app

You don't need a shell for this
adb reboot recovery
Should do the trick, opening a shell gets you into the phones file system which is not needed to reboot to recovery
Just do a quick Google search and you will find many guides on this, especially here in xda
Sent from my Nexus 7 using XDA Premium 4 mobile app

Related

SU request issue, help please

ok so on most roms this happens. i need a SU request but my phone freezes obn a black screen and on the top in gray it says SU request. i wait paciently and maybe 1-2 mins later is asks to FC because its not responding. is there a fix or what am i doing wrong. usb debugging is on and so is install nonmarket apps idk wtf im doing wrong or if somthing is just not working. any input??
I've heard su is not working properly until you activate it once via adb. In your teriminal (cmd or similar)
Code:
adb shell
$su
You should get a working super user request after which all other su requests should work fine.
Marisa said:
I've heard su is not working properly until you activate it once via adb. In your teriminal (cmd or similar)
Code:
adb shell
$su
You should get a working super user request after which all other su requests should work fine.
Click to expand...
Click to collapse
yes same thing happens to me
plug in your phone
goto your android sdk tools
and input adb shell
now go back to your phone and try it while still plugged
thats what i have been doing...
the same thing is happening for me and the instructions of simply input adb shell into terminal arent helping really. if someone could tell me exactly where to be aiming the command prompt and what the exact commands are in order to fix this I would greatly appreciate it.
WalkingTaco said:
the same thing is happening for me and the instructions of simply input adb shell into terminal arent helping really. if someone could tell me exactly where to be aiming the command prompt and what the exact commands are in order to fix this I would greatly appreciate it.
Click to expand...
Click to collapse
Are you getting the same crshes and things, but when you do the adb shell # pops up instead of $?
whenever i do adb shell I get #, so that means SU is already activated, but it's actually not on my phone, so i have no idea what's going on and no one seems to know how to fix it.
no. my Su permissions always force close after a minute of black screen. there is a fix posted above but my nerd level is not high enough to.infer the rest
Sent from my Eris using the XDA mobile application powered by Tapatalk
I don't know the exact command prompt setup, I'm running linux. However, when you originally rooted your phone you used the Android SDK correct?
With your phone plugged in, and USB Debugging enabled on your phone (Settings -> Applications -> Development -> USB Debugging) Open command prompt and get to the tools directory you used during rooting, I don't know where you installed it, so I cannot guide you through that part. If you used Ivan's guide http://forum.xda-developers.com/showthread.php?t=647707 it's probably best to refresh yourself there.
Once you've found your SDK /tools/ in command prompt, it should be as easy as running the code I mentioned earlier
Code:
adb shell
$su
in the command prompt.
The superuser prompt should show up on your phone, tell it to allow it and it should work without fail until you flash a new ROM that has the bug.
thanks very much. I used Ivans guide. I rooted it yesterday when o got my replacement from Verizon in store. I had been using the 2.1 leak on my old one and complained in store for thirty seconds. they didn't even look at it gave me a replacement in ten minutes
Sent from my Eris using the XDA mobile application powered by Tapatalk
Rock out thanks for the Super Help

[GUIDE] ADB - Usage, Tips, Tricks and More!

*****To all newebies(as quite a few new people are at this forum because they got their first device! (TFP)) any anyone who wants to learn, let’s get educated about our devices!*****
ADB (Android Debug Bridge) is an extremely useful tool that WILL help you in all of your customizing needs! You may see the need to use ADB commands to help root your device, change ROMS, or send your device a fix. Without the knowledge here, you could easily be left in the dark.
ADB is a necessity for developers and general consumers alike. Knowing this tool is a great advantage to you to help your device at the best quality possible.
Installation
Download Google SDK
Choose the correct operating system and install!
The installation REQUIRES Java JDK which can be downloaded from Here
If during installation it asks for JDK (and you have installed it) Press the back button and next again, sometimes that will fix the error.
**Note** The SDK installs to C:\Program Files (x86)\Android\android-sdk standard, chose any directory for you
Start the SDK and immediately, you will notice a few checkboxes. For the standard user, just make sure Android SDK Platform-tools (under Tools) and Google USB Driver package (under Extras) – the drivers are always good to have, latest ADB drviers.
Click install 2 packages and wait. Once installed go to your installation directory and find the platform-tools folder. This directory is your ADB and will be your lifeline!
**Do you want ADB accessible through any command prompt directory?**
You are in luck. (For Windows 7)
Right click on My Computer > Properties > Advanced System Settings >Advanced (Tab) > Environment Variables > Under System Variables scroll and dbl click on Path
TO THE END of the Variable value line add
Code:
;C:\Program Files (x86)\Android\android-sdk\platform-tools
Or whatever the directory you installed to + platform-tools
Open CMD and type ADB, if you did it right, you will see proper ADB jargon regardless if you are in the correct directory or not!
Congratulations! ADB is installed!
**Make sure your device is using the latest drivers (that you just downloaded) or other ADB drivers provided by ASUS to access ADB. When connected in Debugging mode, device manager will have: ASUS Android Composite ADB Interface**
ADB Usage
**I will be talking mainly about commands/arguments that the general end-user may use or come across**
**Make sure your tablet is in USB Debugging Mode to be able to connect to ADB (Settings > Applications)**
ADB Devices : This command shows all connected android devices that will respond to an ADB command. It is useful for making sure your device is connected.
ADB Connect [IPORT] : This command will connect to your device over personal WIFI connection if your device is setup for ADB over WIFI (Requires root and NOT recommended)
ADB Push [local_file] [remote_file] : This command will push any local file to the device (only if the device is Read/Writable. Stock /system/ folders are only Readable.
ADB Pull [Remote_file or Directory] [Save file or Directory] : This command take files or an entire directory and save it to your desired location. This command only works when directory is read/Writable.
ADB Shell [command] : This command will perform most UNIX commands on the device. Without a command, you can enter several shell commands before you ‘exit’. Most will not work unless SU is applied (# instead of $). Must be rooted for SU. Only play with these commands if they are known by you or exactly copied from instructions.
ADB Logcat [ > file.txt ] : This command will display (or save per > file.txt) a log of what’s happening on the device. If you are receiving errors, turn on logcat, reproduce error, turn off, and send logcat to the developer.
ADB Install [-r][-s] [local_apk] : This command force installs (or reinstalls –r or –s installs on SD-Card) any APK provided.
ADB Uninstall [-k] [APK_Name] : This command uninstalls any APK Name provided (app.apk) and will even keep cache and other data with the –k tag.
ADB start-server : This command will start the server if the server is off or killed. (Normally server will auto-start when ADB command is used)
ADB kill-server : This command will close ADB server. Useful if ADB server is acting up or not connecting to any devices.
ADB remount : This command will mounts the /system/ partition Read/Writable pending the device is allow to. Stock TFP will NOT.
ADB root : This command will restart ADB with root permissions if the build allows for it. Stock TFP will NOT.
ADB usb : This command will restart ADB on device to use USB connection for ADB communication.
ADB tcpip [port] : This command will restart ADB on device to use TCPIP connection for ADB. Standard port is 5555. Again, this connect not recommended for file transfers.
ADB reboot [recovery/bootloader] : This command will restart your device. If either of the two options are given, the device will boot into that mode (sadly TFP does not support the two options.. yet)
ADB Tips/Tricks
When following ADB instructions, follow them WORD-BY-WORD in the EXACT ORDER GIVEN. If copy and pasting their commands (one line at a time) makes it easier, then do so.
If you have root access, do not mess around in ADB shell unless you know what you are doing
Connecting over IP can be beneficial for you for quick ADB access, but for file transfers, speed is slow and you ALWAYS risk corruption (check the md5!) One bad file and you have boot-loops!
ADB Logcat is an amazing command. If anything is wrong with your device, 9/10 you can see it in logcat. If you can find the exact problem, fixes can happen much easier. USE LOGCAT TO YOUR ADVANTAGE!
ADB reboot can be a quick reboot, sometimes you don’t feel like waiting!
Use the environmental variables! It helps exponentially, and keeps from having multiple instances of ADB running.
When multiple instances of ADB are running (different directories) ADB can get messed up! (ADB not up-to-date restarts, and connect problems). ASUS Sync service has and ADB setup. Turn it off if you are not using it. Try to stick to only ONE instance of ADB
Eventually, we may have root access in our recovery kernel. Then and only then can our devices be truly customizable!
The GUIDE is not finite. Please post anything you feel should be added/corrected to the guide. Please take notice from this, as the understanding of these simple commands could help save your device(s)!
Thanks and 5 star would make me feel good inside too!
Wow... Nice post. Lots of time went into this lol. Thanks can't give the five stars in the app though:-(
Sent from my Transformer Prime TF201 using xda premium
The link in step #1 is whack - I think you want tis? http://developer.android.com/sdk/index.html
Lock-N-Load said:
The link in step #1 is whack - I think you want tis? http://developer.android.com/sdk/index.html
Click to expand...
Click to collapse
hmm thats what was in there, i re-saved and it works now ... maybe xda error
thanks tho!
biggem001 said:
hmm thats what was in there, i re-saved and it works now ... maybe xda error
thanks tho!
Click to expand...
Click to collapse
before you fixed it, it was trying to use this http://http://developer.android.com/sdk/index.html"
note the extra parens at the end and the double http call
i noticed that too, all i did was re-save and it worked. how weird.
Thanks! I've seen a few tutorials on this but this one was by far the easiest to follow and best organized. Short and sweet. Worked on my desktop great, I've never managed to install it right D:
Re posting to give 5 stars. Thanks again OP
Quick question: Is it normal for PTP mode to be required for adb to work? Because as soon as I switch to MTP I can no longer use adb.
cmat1120 said:
Quick question: Is it normal for PTP mode to be required for adb to work? Because as soon as I switch to MTP I can no longer use adb.
Click to expand...
Click to collapse
i can do either at once.. thats weird
GPS, Wifi and BT Testing
Could someone write some basic tutorials on how to verify/test GPS, wifi and BT funtions? For those of us who are new to Android it would helpful in verifying which problems are truly present. Also perhaps show how to find the serial number - for example: some don't know you have to click status - because there are a some erroneous posts out there. There may be users who assume something works or doesn't work, based on limited knowledge and these inaccurate findings only serve to muddy up the works.
There's a lot of animosity about the influx of newbies (and trust me, as a newbie it doesn't feel good). I think the first step is to educate. If some of these troubleshooting steps are laid out, more people can contribute in an intelligent way.
I thought this would be a good thread for the Guides thread, but it is closed and I cannot send PMs.
Thanks - Great Info
One thing you can add for all us amateurs is how to use ADB to install off market apps, stuff like that. Things the non-power user can benefit from. Some simple command line structure would be great.
theandies said:
One thing you can add for all us amateurs is how to use ADB to install off market apps, stuff like that. Things the non-power user can benefit from. Some simple command line structure would be great.
Click to expand...
Click to collapse
i wont add it to the guide, because adb install is pretty self explanatory but this
make sure you can install non-market apps
Code:
adb install app.apk
jonalisa said:
Could someone write some basic tutorials on how to verify/test GPS, wifi and BT funtions? For those of us who are new to Android it would helpful in verifying which problems are truly present. Also perhaps show how to find the serial number - for example: some don't know you have to click status - because there are a some erroneous posts out there. There may be users who assume something works or doesn't work, based on limited knowledge and these inaccurate findings only serve to muddy up the works.
There's a lot of animosity about the influx of newbies (and trust me, as a newbie it doesn't feel good). I think the first step is to educate. If some of these troubleshooting steps are laid out, more people can contribute in an intelligent way.
I thought this would be a good thread for the Guides thread, but it is closed and I cannot send PMs.
Click to expand...
Click to collapse
for GPS, use GPS Test app on the market
for BT and wifi testing, i'll just connect my device via BT or adhoc wifi and do the testing on my PC itself, more accurate and better programs
Excellent howto, thanks
I have trouble connecting to my prime with adb. In the Win7 Device Manager the correct device shows up, no exclamation mark at all, but adb just won't see the Prime.
USB debugging mode is on, no Asus Sync software on the PC. I have no clue why ADB won't see my device.
Now many of us can really shoot ourself in the foot.
by far the best and quickest adb install/setup ever. thanks OP!
neo1738 said:
by far the best and quickest adb install/setup ever. thanks OP!
Click to expand...
Click to collapse
aw shucks!
THANKS!
biggem001 said:
ADB Devices : This command shows all connected android devices that will respond to an ADB command. It is useful for making sure your device is connected.
ADB Connect [IPORT] : This command will connect to your device over personal WIFI connection if your device is setup for ADB over WIFI (Requires root and NOT recommended)
ADB Push [local_file] [remote_file] : This command will push any local file to the device (only if the device is Read/Writable. Stock /system/ folders are only Readable.
ADB Pull [Remote_file or Directory] [Save file or Directory] : This command take files or an entire directory and save it to your desired location. This command only works when directory is read/Writable.
ADB Shell [command] : This command will perform most UNIX commands on the device. Without a command, you can enter several shell commands before you ‘exit’. Most will not work unless SU is applied (# instead of $). Must be rooted for SU. Only play with these commands if they are known by you or exactly copied from instructions.
ADB Logcat [ > file.txt ] : This command will display (or save per > file.txt) a log of what’s happening on the device. If you are receiving errors, turn on logcat, reproduce error, turn off, and send logcat to the developer.
ADB Install [-r][-s] [local_apk] : This command force installs (or reinstalls –r or –s installs on SD-Card) any APK provided.
ADB Uninstall [-k] [APK_Name] : This command uninstalls any APK Name provided (app.apk) and will even keep cache and other data with the –k tag.
Click to expand...
Click to collapse
Just a small suggestion, adb won't accept commands if they are capitalized.
For example "ADB devices" will work perfectly, but "ADB Devices" won't.
So, in order to help the newest of newbies, you might want to put the commands in lowercase in the first post.

I could not unlock my phone

Hey can anyone please help. I get to step 7 and it never recognizes my command prompt I've tried the htc supertool also and that does nothing can someone please help
Sent from my ADR6425LVW using XDA App
Make sure you are typing cd before the dir your trying to get into as well as \ and not /.
I did that and it said too many directories or something like that
Sent from my ADR6425LVW using XDA App
Which root method are you actually using? And what exact error are you getting.
Make sure you're running as administrator, beyond that need more information to try to help.
Make sure that when you have all the files from SDK manager that you store them in a file named "Android" in your "C:" drive (Files should include fastboot, adb, and adb_win_api.dll)
in command prompt, type in "cd \Android" then continue from there.
Hope this helps
Also if you need further help and I'm not replying here, send me a message.

[Q] adb ?????????????? no permissions in ubuntu

I'm in a recovery boot loop and need to be able to access adb from recovery. I'm running ubuntu and adb devices while in recovery shows ?????????????? no permissions. Can somebody please help me. I think it may be as simple as a rule change somewhere but thats just a guess. Thanks guys.
newellj79 said:
I'm in a recovery boot loop and need to be able to access adb from recovery. I'm running ubuntu and adb devices while in recovery shows ?????????????? no permissions. Can somebody please help me. I think it may be as simple as a rule change somewhere but thats just a guess. Thanks guys.
Click to expand...
Click to collapse
Try this:
sudo su
adb start-server (preceeded by adb kill-server if adb already running). NOTE: You may have to change the path to adb since you are using Superuser to start the server, it may not be in your .bashrc.
exit
Then, run adb devices and see what you get. Happened to me with the EVO 3D and the above worked for me. Starting the adb server with SU permissions works.
pinky059 said:
Try this:
sudo su
adb start-server (preceeded by adb kill-server if adb already running). NOTE: You may have to change the path to adb since you are using Superuser to start the server, it may not be in your .bashrc.
exit
Then, run adb devices and see what you get. Happened to me with the EVO 3D and the above worked for me. Starting the adb server with SU permissions works.
Click to expand...
Click to collapse
Thanks. That got it,
Sent from my T-Mobile myTouch 3G using XDA
The file to check would an udev rules file. See where ubuntu keeps it.
Sent from my i9250

[Q] ADB Command Execution problem

I have my phone connected to my laptop via the USB cable and the ADB is able to identify the device. When i run adb devices it returns the phone in the list of connected devices. Running the command adb shell now gives an error stating:
reloc_library cannot locate 'fdatasync'
Infact running any command on the terminal emulator installed on my phone also returns me the same error.
Has anyone faced the same problem or has any pointers to a solution to it?
Please use the Q&A Forum for questions &
Read the Forum Rules Ref Posting
Moving to Q&A
anuj142003 said:
I have my phone connected to my laptop via the USB cable and the ADB is able to identify the device. When i run adb devices it returns the phone in the list of connected devices. Running the command adb shell now gives an error stating:
reloc_library cannot locate 'fdatasync'
Infact running any command on the terminal emulator installed on my phone also returns me the same error.
Has anyone faced the same problem or has any pointers to a solution to it?
Click to expand...
Click to collapse
Do you have busybox installed? It seems as if the /bin directory doesnt exist or contain the proper files. Thats about all i got as of now
I have not been able to install busybox on my system. I have tried all possible versions and all possible ways of getting it installed but nothing works.
whats meant by "nothing works"? in fact you clearly installed something on your phone so it cannot start a shell anymore, did you reboot after you played around?
I have not been able to install busybox on my system. I have tried all possible versions and all possible ways of getting it installed but nothing works.
Click to expand...
Click to collapse
Well that is more than likely the issue, are you rooted? And you've tried the busybox installer from the market?
Sent from my GT-I9100 using Tapatalk
When i say "nothing works" what i mean is i have tried various busybox installers on the market and none of them seemed to work. Everytime i get the error stating that BusyBox could not be installed.
I have tried rebooting multiple times as well.
elesbb said:
Well that is more than likely the issue, are you rooted? And you've tried the busybox installer from the market?
Sent from my GT-I9100 using Tapatalk
Click to expand...
Click to collapse
Yes, my phone is rooted and yes i have tried the busybox installers from the market.

Categories

Resources