This is a re-post of a thread I wrote over on the Xoom Forums. I browsed the web looking for all the ADB commands I could find and made up this list and included some examples of what gets typed to help people understand how to use it. I was new to ADB when I wrote this (I usually used RSDLite on the OG Droid), so it hopefully can help other newcomers get comfortable with it. Out of many of the tools out there, ADB can help get you out of a pinch if you mess something up, sometimes even when Odin cannot.
--------------------------------------------------
Basic commands for newcomers to ADB
**If a line of code includes <xxx> in the first line, then a second line in RED, the second line is an example to help you better understand the format.
ADB stands for "Android Debug Bridge". It comes with the android sdk and can be run from the windows command prompt or a mac/linux terminal. For instructions on setting up ADB, please see the thread on how to set up ADB. In order to run ADB from your machine, you will need ensure the following in your Android device "Settings" is set:
Settings -> Application Settings -> Development -> Then check the "USB Debugging" box.
To open a command window/terminal, in Windows go to Start > Run and type "cmd" (no quotes). Prior to using any of these commands, you will need to change the directory to the ADB folder on your machine. If using the default install location for the
Windows install, this would be C:\android-sdk-<machine-platform> and either the /platform-tools or /tools sub-directory, depending which one you copied all the files in. In this example I used the tools sub-directory on a Windows PC.
** - The "cd" part of the command tells the system to "change directory" to path that follows.Code:cd C:\android-sdk-windows\tools
Command/Terminal Window Tips:
1) Pressing the "Tab" key will get the previous command entered.
2) You can also use the right arrow key to repeat the previous command, character by character, which can be a time saver if the following lines all start off the same.
To see /check devices connected to your system (hit return/enter to run command):
In response, adb prints this status information for each instance:Code:adb devices
Serial number — A string created by adb to uniquely identify an emulator/device instance by its console port number.
<type>-<consolePort>.
State — The connection state of the instance. Two states are supported:
offline — the instance is not connected to adb or is not responding.
device — the instance is now connected to the adb server. Note that this state does not imply that the Android system is fully booted and operational, since the instance connects to adb while the system is still booting. However, after boot-up, this is the normal operational state of an emulator/device instance
If there is no emulator/device running, adb returns "no device".
REMEMBER!!! You must hit return/enter after each command (or line) to run!
**If a line of code includes <xxx> in the first line, then a second line in RED, the second line is an example to help you better understand the format.
Pull/Push/Install Apps & Files:
To install an app:
To re-install an app, keeping it's data:Code:adb install <path_to_apk> adb install myapp.apk
To push apps from computer to phoneCode:adb install -r <path to apk> adb install -r myapp.apk
To pull apps from phone to computerCode:adb push <path to file on phone> <path to location on device> adb push test.txt /sdcard/test.txt
To clarify the path: In the examples above, the files were placed into the android-sdk/tools folder where ADB defaults to push them, or pull them. So test.txt just means the default path is: C:/android-sdk/tools/test.txtCode:adb pull <path to file on device> <file name for computer> adb pull /sdcard/test.txt test.txt
Reboot Commands:
Reboot your device:
Reboot device into Recovery mode:Code:adb reboot
Reboots the device into bootloader mode:Code:adb reboot recovery
Reboots the device into Fastboot mode:Code:adb reboot bootloader
Code:adb reboot fastboot
View Information:
Print a list of supported adb commands:
Print the ADB version number:Code:adb help
Code:adb version
Commands helpful in troubleshooting:
Compile a bug report:
Logcat - starts dumping debugging information from your device to the console – useful for debugging (may have to press control+c to exit):Code:adb bugreport
To output the logcat file to the folder you are running ADB from:Code:adb logcat
Code:adb logcat > logcat.txt
Miscellaneous Commands:
Remount remounts the /system partition as writable (or readonly if it is already writeable):
An example for use would be if you have pulled the framework-res.apk file from your device and want to push it back to the phone, you have to ensure the /system folder is writeable first so that you can push the modified file back to the phone.Code:adb remount
Shell Commands:
Shell lets you run an interactive shell (command prompt) on the Android device:
Look at the tasks running on your device:Code:adb shell
Check Memory Usage:Code:adb shell top
To fix permissions on your device:Code:adb shell free
Code:adb shell fix_permissions
Fastboot Commands:
List devices currently attached to computers:
Unlocks a locked bootloader (must be rebooted into bootloader):Code:fastboot devices
To flash a Recovery image file:Code:fastboot oem unlock
Reboot device while in fastboot:Code:fastboot flash recovery recovery.img
**Boots a ROM stored on your computer specified by the filename**Code:fastboot reboot
**Flashes a ROM stored on your computer, partition can be one of {boot, recovery, system, userdata}**Code:fastboot boot <filename>
** - WARNING: I have not confirmed these last 2 commands work, but included them in case someone ends up here looking for them. Only use them if you know exactly what you are doing as I cannot confirm what it will do.Code:fastboot flash <partition> <filename>
More to be added as the thread expands.




7Likes
LinkBack URL
About LinkBacks





Reply With Quote




