Android Debugging Tools adb command Daquan _android

Source: Internet
Author: User
Tags linux shell commands tmp folder

I. Introduction of ADB
The SDK's Tools folder contains important commands for the Android emulator Operation ADB,ADB is called (The Android Debug Bridge is the function of the debugging bridges.) Through the ADB we can debug the Android program through DDMS in Eclipse. With this tool, we can manage the status of the device or phone simulator. You can also perform the following actions:

1, fast update equipment or mobile phone simulator code, such as applications or Android system upgrades;
2, on the device to run the shell command;
3, management equipment or mobile phone simulator on the reservation port;
4, in the equipment or mobile phone simulator copy or paste files;
Ii. ADB's work in the integrated development environment
The ADB works in a particularly special way to have the IDE and QEMU communicate by listening to ports such as socket TCP 5554, and by default ADB will daemon the associated network port, so the ADB process runs automatically when we run eclipse.
1. Through the ADB can easily execute Linux shell commands, such as the adb Shell dir is the listing directory, in Linux root directory is/instead of Windows C disk, D disk.
2. Install the APK program to the simulator then execute adb install android123.apk, so that the installation package named Android123 will be installed in the Android emulator, provided that android123.apk files need to be placed in sdk/ Tools directory.
3. Transfer files to emulator and use the ADB push android123.txt/tmp/android123.txt command to transfer android123.txt files 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. Return files to the computer from the Android emulator
Through the ADB pull/tmp/android123.txt android123.txt command, the Android123.txt file in the emulator's TMP folder is uploaded back to the computer Sdk/tools directory.
three, the ADB commonly used order Daquan
1. Display all Android platforms in the system:
Android list targets
2. Display all AVD in the system (simulator):
Android List AVD
3. Create AVD (Simulator):
Android Create AVD--name name--target platform number
4. Start Simulator:
EMULATOR-AVD name-sdcard ~/name. IMG (-skin 1280x800)
5. Delete 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. Display all emulators currently running:
ADB devices
10. Execute a command on an emulator:
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 files to the emulator:
ADB push <local> <remote>
14. Into the simulator shell mode:
ADB shell
15. Launch SDK, documentation, instance download Manager:
Android
16. Unloading Carrier APK Package:
ADB shell
CD Data/app
RM apk Pack
Exit
The main package name for the ADB uninstall APK package
ADB install-r APK Package
17. View ADB command Help information:
ADB Help
18. View log information at the command line:
ADB logcat-s label Signature
The commands behind the ADB shell come mainly from:
SOURCE \system\core\toolbox directory and source \frameworks\base\cmds directory.
20. Delete System Application:
ADB remount (Mounts the system partition to make the system partition writable again).
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. Post Port:
You can set any port number as the host to the simulator or the device's request ports. Such as:
ADB forward tcp:5555 tcp:8000
24, copy the file:
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, Search Simulator/equipment Examples:
Gets the list of instances of the currently running emulator/device and the status of each instance:
ADB devices
26, view the bug report:
ADB bugreport
27, record the wireless communication log:
Generally speaking, the wireless communication log is very many, in the runtime does not need to record, but we still can through the command, sets the record:
ADB shell
Logcat-b Radio
28, get the device ID and serial number:
ADB get-product
ADB Get-serialno
29, access to the database SQLite3
ADB shell
Sqlite3
#cd System/sd/data//access to the specified folder within the system
#ls//List displays current folder contents
#rm-R xxx//delete folder with Name xxx and all files inside it
#rm XXX//delete file xxx
#rmdir xxx//delete XXX's folder

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.