Android: Commonly Used adb commands

Source: Internet
Author: User

Android: Commonly Used adb commands


1. List the current configurations:
Adb devices
For example:
Localhost :~ Newuser $ adb devices
List of devices attached
BH903QDW15 device
41008990d29eb000 device


2. For a device
Adb-s  

For example:
Adb-s BH903QDW15 install hello.apk


3. Install the app
Adb install


4. File Replication
4.1 pull from mobile phone to local
Adb pull
For example:
Adb pull/sdcard/foo.txt
4.2 push from local to mobile phone
Adb push
For example:
Adb push foo.txt/sdcard/foo.txt


5. uninstall software
Adb shell pm uninstall
For example:
Adb-s BH903QDW15 shell pm uninstall-k com. example. hello
-K is retained after uninstallation.
Note: adb shell pm [command]
There are a lot of commands: see: http://developer.android.com/tools/help/adb.html


6. screen recording:
Adb shell screenrecord/sdcard/demo.mp4
After recording, you can use pull to copy the file to a local device. For more information, see 4.1


7. view all adb shell commands
Adb shell ls/system/bin


8. randomly click test on the screen:
Adb shell monkey-v-p


9. List the package names of the installed software:
Adb shell pm list packages
For example, list the third-party software package names:

Adb shell pm list packages-3

 

10. View printed logs

Adb logcat

For example:

 

Output Error Log adb logcat E

Logcat Filtering:

 

Adb logcat | grep-I debug

Logs containing debug strings

 


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.