Adb is a very commonly used command for debugging during development. Let’s talk about the commonly used adb commands. Simplify adb connection commands If you specify an IP connection, it is usually adb connect 172.18.xxx.xxx. In this way, you will find that there are repeated commands to type each time you connect. Programmers want to reduce repetitive work, so now you can save the repeated commands. (The following is the configuration method under Mac):
The above is just an example, you can add other simplified commands in the .alias_bash file. adb multiple device specified connection When using adb to connect to multiple devices, when you want to connect to the shell of a certain device, use adb -s 172.18.xx.xx:5555 shell. If it is other commands, you can specify the device to execute. For example:
adb file processing Copy files from your computer to your device Order:
example:
Copy the files from the device to the computer Order:
The directory parameter on the computer can be omitted and the directory will be copied to the current directory by default. example:
adb install uninstall application adb install application Command format:
parameter: adb install can be followed by some optional parameters to control the behavior of installing APK. The available parameters and their meanings are as follows: If you see output similar to the following after running the command (status is Success), the installation is successful:
adb uninstall application Order:
Indicates the package name of the application. The -k parameter is optional and indicates uninstalling the application but retaining the data and cache directory. Command example:
adb start application Start the activity Command format:
For example:
If you want to add parameters to the launched Intent, you can add them in key-value format.
Start the servies Command format:
For example:
Indicates calling up the music service. Sending Broadcasts Command format:
You can broadcast to all components or only to specified components. For example, broadcast BOOT_COMPLETED to all components:
Send a broadcast to the specified receiver, example:
If the broadcast has parameters, add the parameter key and value at the end. For example:
adb kill process Order:
Command example:
adb clear application cache, etc. Order:
Indicates the application package name. The effect of this command is equivalent to clicking "Clear Cache" and "Clear Data" in the application information interface in the settings. Command example:
adb simulated events Order:
example:
adb view log Command format:
example:
Android logs are divided into the following priorities:
Filter the specified TAG
Other common commands View application list information The basic command format for viewing the application list is
That is, based on adb shell pm list packages, you can add some parameters to filter and view different lists. The supported filtering parameters are as follows: For example: Third-party apps
Applications whose package names contain a certain string
View the command that contains the string aaron in the package name
View the front-end Activity Order:
View running Services Order:
The parameter is not required. If specified, it means viewing the Services related to a certain package name. If not specified, it means viewing all Services. CPU Information Order:
Memory information Memory information Order:
Among them, MemTotal is the total memory of the device, and MemFree is the current free memory. View CPU usage ranking Order:
Summarize: There are many other commands for adb, which are not listed here. For more information, please refer to the help information of adb command. |
<<: Tech Neo August Issue: Language Choice
If Apple and Google hadn't added an app store...
What is exchange volume ? Traffic exchange means ...
On New Year's Eve, December 31, 2024, a video...
According to macrumors, Apple today released the ...
We all know that operation is a meticulous and co...
Sanyan Finance reported on August 14 that today, ...
1. Account Structure Concept The account structur...
Mixed Knowledge Specially designed to cure confus...
As people's behavioral habits gradually move ...
How much does it cost to join the Linzhi Travel A...
Is Bilibili still communicating with Generation Z...
FIFA and Pro Evolution Soccer, as the old series ...
Users are paying more and more attention to the e...
Rectal examination, stool examination, breast pal...
[[182181]]...