ADB introduction
The SDK's Tools folder contains an important command of the Android emulator Operation ADB,ADB is all called (Android Debug Bridge is the role of debug bridges. With ADB we can debug Android programs via Ddms in Eclipse. With this tool, we can manage the status of the device or phone simulator. You can also do the following:
1. Quickly update the code in the device or phone simulator, such as app or Android system upgrade;
2. Run the shell command on the device;
3, management equipment or mobile phone simulator on the predetermined port;
4. Copy or paste files on the device or phone simulator;
ADB's work in an integrated development environment
ADB's way of working is a special use to listen to socket TCP 5554 and other ports to the IDE and QEMU communication, by default ADB will daemon the relevant network port, so when we run eclipse, the ADB process will run automatically.
1. The ADB can easily execute Linux shell commands, such as the adb Shell dir is the listing directory, the root directory in Linux/instead of Windows C, D disk.
2. Install the APK program to the emulator to execute the ADB install android123.apk, so that the installation package named Android123 will be installed in the Android emulator, provided that the android123.apk file needs to be placed in the sdk/ Tools directory.
3. Transfer files to emulator, use the ADB push android123.txt/tmp/android123.txt command to transfer the Android123.txt file under Sdk/tools to the/tmp/folder of the simulator, It is important to note that the contents of the/tmp/folder are emptied when the Android emulator restarts.
4. Returning files from the Android emulator to your computer
Through the ADB pull/tmp/android123.txt android123.txt command will be the emulator's TMP folder under the Android123.txt file back to the computer Sdk/tools directory.
The common Command Encyclopedia of ADB
1. Display all Android platforms in the system:
Android list targets
2. Display all AVD (simulator) in the system:
Android List AvD
3. Create an AVD (simulator):
Android Create AVD--name name--target platform number
4. Start the emulator:
emulator-avd name-sdcard ~/name. IMG (-skin 1280x800)
5. Delete the AVD (simulator):
Android Delete AVD--name name
6. Create SDcard:
mksdcard 1024M ~/name. IMG
7. AVD (simulator) Location:
Linux (~/.ANDROID/AVD) Windows (C:\Documents and SETTINGS\ADMINISTRATOR\.ANDROID\AVD)
8. Start Ddms:
Ddms
9. Displays all the emulators currently running:
ADB devices
10. Execute a command on a simulator:
abd-s Simulator number command
11. Install the application:
adb install-r application. APK
12. Get the files in the emulator:
adb pull <remote> <local>
13. Write the file to the emulator:
adb push <local> <remote>
14. Enter the shell mode of the simulator:
adb Shell
15. Launch the SDK, documentation, instance download Manager:
Android
16. Unloading APK Package:
adb Shell
CD Data/app
RM apk Package
Exit
The main package name of the ADB uninstall APK package
adb install-r apk package
17. View the ADB command Help information:
adb Help
18. View the log information on the command line:
adb logcat-s tag name
The commands behind the ADB shell come mainly from:
SOURCE \system\core\toolbox directory and source code \FRAMEWORKS\BASE\CMDS directory.
20. Remove the System application:
adb remount (re-mount the system partition so that the system partition is re-writable).
ADB shell
CD System/app
RM *.apk
21. Get Administrator Privileges:
adb root
22. Start activity:
adb shell am START-N package Name/package name + class name (-N class name,-a action,-d date,-m mime-type,-c category,-e Extended data, etc.).
23. Release Port:
you can set any port number as the request port for the host to the emulator or device. Such as:
ADB forward tcp:5555 tcp:8000
24. Copy files:
You can copy files to a device or from a device,
To copy a file or directory to a device or emulator:
adb push <source> <destination></destination></source>
such as: adb push test.txt/tmp/test.txt
To copy a file or directory from a device or emulator:
adb pull <source> <destination></destination></source>
such as: ADB pull/addroid/lib/libwebcore.so.
25, the Search simulator/device instance:
Gets a list of instances of the currently running emulator/device and the status of each instance:
ADB devices
26. Check the bug report:
ADB bugreport
27. Record the wireless communication log:
Generally speaking, the wireless communication log is very many, at run time not necessary to record, but we can still through the command, set the record:
adb shell
Logcat-b Radio
28. Get the ID and serial number of the device:
adb get-product
ADB Get-serialno
29. Accessing the database SQLite3
adb shell
Sqlite3
#cd system/sd/data//Enter the specified folder within the system
#ls//list displays the contents of the current folder
#rm-R xxx//delete the folder with the name xxx and all the files inside it
#rm XXX//delete file xxx
#rmdir xxx//delete xxx folder
Original: http://www.open-open.com/lib/view/1327557366686