Running "adb" on LG-P925g USB Debugging Interface

This section provides a tutorial example on how to run 'adb' commands on LG-P925g Android phone through the USB debugging interface. 'adb -d' is to run commands on the USB device. 'adb -e' is to run commands on the emulator.

With my LG-P925g Android phone connected in USB debugging mode, I can try some Android SDK debugging tools on my Windows computer now.

The first I want to try is the ADB (Android Debugging Bridge) tool:

C:\herong>\local\android-sdk-windows\platform-tools\adb devices
List of devices attached
emulator-5554   device
6B30002400000001        device

C:\herong>\local\android-sdk-windows\platform-tools\adb shell date
error: more than one device and emulator

C:\herong>\local\android-sdk-windows\platform-tools\adb -e shell date
Sun Apr 1 23:29:21 GMT 2012

C:\herong>\local\android-sdk-windows\platform-tools\adb -d shell date
Sun Apr 1 19:29:33 GMT 2012

C:\herong>\local\android-sdk-windows\platform-tools\adb -e shell \
   ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=2.52 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=3.69 ms

C:\herong>\local\android-sdk-windows\platform-tools\adb -d shell \
   ping localhost
ping: icmp open socket: Operation not permitted

C:\herong>\local\android-sdk-windows\platform-tools\adb -d shell
$ df
df
/dev: 226052K total, 12K used, 226040K available (block size 4096)
/lgdrm: 2011K total, 1059K used, 952K available (block size 1024)
/mnt/asec: 226052K total, 0K used, 226052K available (block size 4096)
/mnt/tmp: 4096K total, 0K used, 4096K available (block size 4096)
/system: 613840K total, 530296K used, 83544K available (block size 4096)
/data: 1032088K total, 153872K used, 878216K available (block size 4096)
/misc: 3963K total, 1058K used, 2905K available (block size 1024)
/cache: 63472K total, 4144K used, 59328K available (block size 4096)
/mnt/sdcard: 5844864K total, 2368480K used, 3476384K available (bl...
/mnt/secure/asec: Permission denied
$exit
exit

C:\herong>\local\android-sdk-windows\platform-tools\adb -d logcat
--------- beginning of /dev/log/system
I/ActivityManager(  194): Starting activity: Intent { act=android....
I/ActivityManager(  194): process name to start: com.android.setti...
I/ActivityManager(  194): Start proc com.android.settings for acti...
W/Watchdog(  194): handleMessage monitor is completed.
W/Watchdog(  194): handleMessage mCompleted is true...
I/ActivityManager(  194): process name to start: com.lge.hiddenmen...
I/ActivityManager(  194): Start proc com.lge.hiddenmenu for conten...
D/PowerManagerService(  194): setTimeoutLocked mPolicy.isKeyguardS...
D/PowerManagerService(  194): setTimeoutLocked mPolicy.isKeyguardS...
D/PowerManagerService(  194): setTimeoutLocked mPolicy.isKeyguardS...
D/PowerManagerService(  194): setTimeoutLocked mPolicy.isKeyguardS...
I/ActivityManager(  194): Starting activity: Intent { act=android....
...
^C

What I learned here are:

Table of Contents

 About This Book

 Installing JDK 1.8 on Windows System

 Installation of Android SDK R24 and Emulator

 Installing Apache Ant 1.9 on Windows System

 Developing First Android Application - HelloAndroid

 Android Application Package (APK) Files

 Android Debug Bridge (adb) Tool

 Android File Systems

 AboutAndroid - Application to Retrieve System Information

 android.app.Activity Class and Activity Lifecycle

 View Objects and Layout Resource Files

 Using "adb logcat" Command for Debugging

 Build Process and Package File Content

 Building Your Own Web Browser

 Android Command Line Shell

 Samsung Galaxy Tab 3 Mini Tablet

 USB Debugging Applications on Samsung Tablet

 Android Tablet - LG-V905R

 USB Debugging Applications on LG-V905R Tablet

 Android Phone - LG-P925g

USB Debugging Applications on LG-P925g Phone

 Installing LG USB Device Driver on Windows

 Viewing LG Android USB Device in Control Panel

 Turning on USB Debugging on LG-P925g

 Viewing USB Debugging Devices in Control Panel

Running "adb" on LG-P925g USB Debugging Interface

 Installing Application to Phone using "ant installd" Command

 Installing Application to Phone using "adb -d install" Command

 "adb -d install" Command Options

 Installing "AboutAndroid" to LG-P925g Phone

 Developing Applications with Android API Level 7

 Archived Tutorials

 References

 Full Version in PDF/EPUB