ADB shell command

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

ADB overview

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 the integrated development environment   
   ADB works more specifically with the socket TCP 5554 and other ports to enable the IDE and QEMU to communicate, ADB will daemon the associated network ports by default, so the ADB process will run automatically when we run eclipse.   
     1. You can easily execute Linux shell commands via ADB, such as the adb shell dir is the list directory, in the Linux root directory is/ Instead of the C drive and the D drive on Windows.   
     2. Install the APK program to the emulator to execute the ADB install ANDROID123.APK, the installation package named Android123 will be installed in the Android emulator if the android123.apk file needs to be placed in the Sdk/tools directory.   
     3. Transfer files to emulator and use the ADB push android123.txt/tmp/android123.txt command to sdk/ The Android123.txt file under Tools is transferred to the/tmp/folder in the emulator, it is important to note that the contents of the/tmp/folder are emptied when the Android emulator restarts.   
     4. Return files from Android emulator to PC   
   via 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.   
  
ADB common Command
1, install application to simulator:  
  adb Install <path_to_apk></ path_to_apk>  
    Uninstall command

ADB uninstall com.***.***.**** unload command parameter must be the total package name
2. Shell entering the device or simulator:
ADB shell
From the above command, you can enter the device or emulator shell environment, in this Linux shell, you can execute a variety of Linux commands, in addition, if you want to execute only one shell command, you can use the following way:
ADB Shell [command]
For example, the ADB shell DMESG will print out debug information for the kernel.
3. 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
4. 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.
5, the Search simulator/device instance:
Gets a list of instances of the currently running emulator/device and the status of each instance:
ADB devices
6. Check the bug report:
ADB bugreport
7. 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
8. Get the ID and serial number of the device:
ADB get-product
ADB Get-serialno
9. Accessing the database SQLite3
ADB shell
Sqlite3

ADB shell command

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.