3

Click here to load reader

Android debug bridge

Embed Size (px)

DESCRIPTION

Android Debug Bridge (adb):- ADB is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device.

Citation preview

Page 1: Android debug bridge

Mob: +91-963283917

Email: [email protected]

Copyright © 2013 Wavedigitech. All rights reserved.

Android Debug Bridge (ADB)

Page 2: Android debug bridge

Mob: +91-963283917

Email: [email protected]

Copyright © 2013 Wavedigitech. All rights reserved.

Android Debug Bridge (adb):- ADB is a versatile command line tool that lets you

communicate with an emulator instance or connected Android-powered device.

It is a client-server program that includes three components:

A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb

command. Other Android tools such as the ADT plugin and DDMS also create adb clients.

A server, which runs as a background process on your development machine. The server manages

communication between the client and the adb daemon running on an emulator or device.

logcat :- The Android logging system provides a mechanism for collecting and viewing system debug

output. Logs from various applications and portions of the system are collected in a series of circular buffers,

which then can be viewed and filtered by the logcat command. You can use logcat from an

ADB (Android Debug Bridge) shell to view the log messages.

=====================================================================================

Step 1: Using the ADB Command ===================================================================================== At your command prompt, simply type:

adb /* The ADB tool is launched from the command line. */

adb logcat /* start printing out everything that is going on on the device. */

adb logcat -C /* Colour: show logs with color to make them easier to read when viewing.*/

adb logcat -d > Mylogcat.txt /* You can dump the complete logcat to a file like this */

===================================================================================== Connect Android device to your development machine. Now, if you use the ADB devices command, it

should list any attached devices or emulator instances.

adb devices /* list any attached devices or emulator instances */

adb shell /* Begins shell connection with phone */ =====================================================================================

Step 2: Restarting the ADB Server ===================================================================================== (Enabled the USB Debugging:: Go to Menu > Settings > Applications > Development > USB Debugging

adb kill-server /* Terminates the adb server process. */

adb start-server /* Checks whether the adb server process is running and starts it, if not */ =====================================================================================

Since LogCat can get pretty large very quickly you may want to clear from Eclipse or from a terminal

window using.

adb logcat -c

adb logcat Wifi:E *:S -v long > Error-Log.txt And this will only print out any errors associated with Wifi, and anything which is fatal.

In Wifi:E, the :E = to look for Errors, the full list of options is as follows:

V — Verbose (lowest priority)

D — Debug

I — Info (default priority)

W — Warning

E — Error

Page 3: Android debug bridge

Mob: +91-963283917

Email: [email protected]

Copyright © 2013 Wavedigitech. All rights reserved.

F — Fatal

S — Silent (highest priority, on which nothing is ever printed).

=====================================================================================

ADB Push and Pull (Sends/Receive files To/From your phone) - =====================================================================================

adb push < source file path> <device destination file path> (e.x) adb push foo.txt /sdcard/foo.txt

(e.x) adb push c:\example.apk /sdcard/example.apk

adb pull <device source file path> <local destination file path> (e.x) adb pull /system/app/example.apk c:\example.apk

=====================================================================================

App Installation and Removal =====================================================================================

adb install <file path to apk> /* Install command to install an Android package file/ */

adb uninstall <package name> /* remove an existing app by its package name. */

=====================================================================================

Backup and Restore ===========================================================================

You can backup and restore the contents of a device. This has limitations on devices that aren’t rooted.

adb backup /* Taking Backup */ (e.x) adb backup –apk –shared –all –f /backup/Mybackup.ab

/* Backup folder, and save the backup to “c:/backup/mybackup.ab” */

adb restore <archive name> /* restored your phone */ (e.x ) adb restore C:\backup\Mybackup.ab

=====================================================================================

Device Rebooting ===================================================================================== Reboot a device either normally, into the boot loader, or into recovery mode.

adb reboot /* reboots phone */

adb reboot recovery /* reboots phone into recovery */

adb reboot bootloader /* reboots the phone into boot loader the white screen */

adb remount /* remounts the system */

=====================================================================================