Using Android under the ADB shell

Source: Internet
Author: User

ADB is a very useful tool, it can be used to debug the program on the Andorid, we can use it as a PC to access the interface of the Andorid system, through which can be used in the Android system files of various management, if there is root authority, basic all the operation can be completed. Let's start with a simple example to illustrate the use of the ADB shell (this is the host file that modifies the Android system):

Add the \{NDK root}\android-sdk\platform-tools directory to the environment variable before execution, or switch to the directory where Adb.exe is located before executing the command, CD \{ndk root}\android-sdk\ Platform-tools.

ADB Root gets root privileges

ADB remount set/system to read/write

adb pull/system/etc/hosts to download the Hosts file to the PC, the default directory is android-sdk\platform-tools\, after downloading, directly on the PC to complete the modification

ADB push hosts/system/etc/hosts upload the modified files on your PC to your phone

ADB common commands
1, install the application to the 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

Using Android under the ADB shell

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.