First, the main functions of the ADB
ADB (Android Debug Bridge) is a tool in the Android SDK that uses ADB to directly manipulate the Android emulator or the real andriod device. ADB is a client-server program where the client is the computer you use to operate, and the server side is the Android device.
The main functions of ADB are:
1. Run the shell on an Android device (command line)
2. Port mapping for Management simulator or device
3. Upload/download files between the computer and the device
4. Install the local APK software on your computer to your Android emulator or device
Second, ADB set environment variables
If you have installed the Android SDK then you can find it in your SDK directory. \android\sdk\platform-tools This directory, the ADB tool is placed here.
Set environment variables: Copy the path of this directory, we need to set this path to path in the system settings of Windows, after Setup is complete. To start the simulator or connect the real machine with USB, we can then use the ADB in the cmd window.
Iii. commonly used ADB commands
A) adb install <apk file path >
This command installs the specified APK file on the device
b) ADB uninstall < software name >
ADB uninstall-k < software name >
If you add the-K parameter, the software is uninstalled but the configuration and cache files are preserved.
c) ADB shell
This command will log on to the device's shell
adb Shell <command Command >
The following add <command command > will be run directly on the device command, equivalent to executing a remote command
d) ADB help
This command will display the Help information
c) ADB push < Local path > < remote path >
Send files from your computer to your device
ADB remount We also need to use the remount command to get the upload file permission before executing the push command, or it will appear
Read-only error message for file system
d) ADB get-product
Get the ID of the device
e) adb get-serialno
Get the serial number of the device
f) ADB devices
Gets a list of instances of the currently running emulator/device and the status of each instance
g) ADB bugreport
View Bug reports
Iv. Common shell commands
Entering the shell via the adb shell command
A) access to the database
Sqlite3
b) 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:
Logcat-b Radio
c) Delete the app
Android does not provide a command to uninstall the app and needs to manually delete it:
Cd/data/app
RM app name. apk
d) View the catalogue
Ls
e) Print or set the current system time
Date
f) View memory information
Cat/proc/meminfo
g) View CPU information
Cat/proc/cpuinfo
(21) Use of the Android Development and debugging tool ADB