当前位置:网站首页>Detailed explanation of common ADB operation commands of "suggestions collection"

Detailed explanation of common ADB operation commands of "suggestions collection"

2022-07-23 08:49:00 Test kid

1、 View all currently running devices

adb devices

 

 

Return to the current device list

This command is to view the currently connected device , Connected to a computer android The device or emulator will list the displays

2、 Install the software

adb install

Verify success . Need to go to the device data/app Check the package name under the path

 

 

This command will specify apk Files are installed on the device

3、 Uninstall software

adb uninstall < The software name >
adb uninstall -k < The software name >

If added -k Parameters , To uninstall the software but keep the configuration and cache files .

 

  This should be emphasized

Yesterday I was using adb Uninstall program , As a result, it can't be unloaded . The command and system prompt I entered are as follows

[email protected]:~$ adb uninstall com.cto51.student-1.apk
Failure

[email protected]:~$ adb uninstall com.cto51.student-1
Failure

Later found that the original program to unload , only adb uninstall The following parameter should not be .apk file , It's the package name , namely AndroidMainifest.xml Under the node in the file ,package The name specified by the element , As shown below : 

[email protected]:~$ adb uninstall com.cto51.student
Success

That suffix "-2" No more , Because it is not part of the package name , When repeated installation for many times Android Automatically added by the system .

4、 Log in to the device shell( Enter the mobile device terminal )

adb shell

This command will log in to the device shell. After that, you will directly run the equipment command , Equivalent to executing remote commands

5、 Upload files from your computer to your mobile device  

adb push 

use push The command can copy files or folders on the local computer to the device ( mobile phone )

6、 Download files from your device to your computer  

adb pull 

  use pull The command can put the device ( mobile phone ) Copy the files or folders on the computer to the local computer

7、 Display help information

adb help

 8. Delete system application :

adb remount ( Remount the system partition , Make the system partition writable again ).
adb shell
cd system/app
rm *.apk

9、 restart adb command

After running the simulator for a while ,adb It's possible that the service ( stay Windows This service can be found in the process , This service is used for simulators or through USB Real machine service connected by data cable ) There will be anomalies . At this time, we need to re adb Service shutdown and restart .

Of course , restart Eclipse It might solve the problem . But that's more troublesome . If you want to close it manually adb service , You can use the following command .

adb kill-server
 Closing adb After service , To start with the following command adb service .
adb start-server

  Pictured :

10. Port forwarding command , That is, change the network of the simulator TCP Communication port

use : If there are multiple devices , If you want to specify a device operation ; Such as A machine

 

adb -s  Specify the device number when entering the command :adb forward tcp:6100 tcp:7100 // PC On all the 6100 Port communication data will be redirected to the mobile terminal 7100 port server There is no need to input the previous command every time to specify .
adb start-server  Choose whether the service starts adb Service process .

adb kill-server  End adb Service process .

adb logcat  Output log data to screen .

adb shell dumpsys [options]

meminfo  Display memory information 

cpuinfo  Show CPU Information 

account  Show accounts Information 

activity  Show all activities Information about 

window  Display keyboard , Windows and their relationships 

wifi  Show wifi Information 
原网站

版权声明
本文为[Test kid]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207222357350891.html