Page 1 of 1

ADB Basic Tutorial rev.1

PostPosted: Thu Nov 11, 2010 10:02 pm
by Mericon
Hallo all,

here is an short tutorial in using ADB.

First of all you need to turn on Usb debugging on you phone:

Go to Menu > Settings > Applications > Development > USB Debugging

Thats all you need on the phone side.

Yet we prepare our PC for the ADB connection (atm for windows).


download the android sdk:http://dl.google.com/android/android-sdk_r07-windows.zip

and unzip it to C:\

Now its easyer to rename the folder with the sdk to asdk.

Open a CMD in Windows and type in:
Code: Select all
cd c:\asdk\tools


At this moment you are able to use every ADB command but i will help here to.

please be shure that you only connect one android phone at the same time.

Installing an apk through ADB:

To install an apk through ADB use
Code: Select all
adb install <path_to_apk>


debugging with ADB:

Here are more things you can do.

logcat:
Code: Select all
adb logcat <option> <filter-specs>
Prints log data to the screen

bugreport:
Code: Select all
adb bugreport
Prints dumpsys, dumpstate, and logcat data to the screen.


Up and download files:

push:
Code: Select all
ADB push c:\example.apk /sdcard/example.apk
sends files to your phone

pull:
Code: Select all
adb pull /system/app/example.apk c:\example.apk
Receives files from your phone

Other commands:

reboot:
Code: Select all
adb reboot
reboots phone !!!DIDNT WORK WITH JETDROID!!! ONLY SHUTDOWN THE PHONE

remount:
Code: Select all
adb remount
remounts the system !!! NOT TESTED


UPDATE:
In some cases it's useful to send the output of the console directly to a text file.
You can do that by adding "> filename.txt" to the command.

Examples:

adb logcat > logcat.txt
adb bugreport > D:\bugreport.txt

So that were the real basics :)

i hope ein could help you.

For more informations look at: http://developer.android.com/guide/developing/tools/adb.html

thanks to Chris nair for the first update :)

greets mericon


UPDATE2:

For a more comfortable experience you can install this great GUI on top of ADB:
http://androidcommander.com/