35. Explanation of Android ADB commands

Source: Internet
Author: User
CMD common Console
1. Clear screen command: CLS
2. List the details of the current directory: Dir
3. delete the file del xxx.txt.
 


Common android ADB commands
1) Create an sdcard
Mksdcard 50 m D:/sdcard. IMG --> Create a 50 m sdcard
 

2) Delete sdcard
Cd d :/
Del sdcard. img
 

32.16.pdf put the ljq.txt file in sdcard
ADB push D:/ljq.txt/sdcard/
 

4) Create an AVD Simulator
Android create AVD-n avd name-T target platform number
For example, Android create AVD-N android2.1-T 8

Error: folder C: \ Users \ Administrator \. Android \ AVD \ ljq. AVD is in the way. Use -- F
OrceIfYou want to overwrite. (go to the C: \ Users \ Administrator \. Android \ AVD \ directory and delete the ljq. AVD folder)

5) Start the simulator
Emulator-AVD xxx
Eg, emulator-AVD android2.1
Start the simulator with sdcard
Emulator-sdcard D:/SD. IMG-AVD android2.1 (name of a virtual device created before android2.1)
 

6) Delete AVD (simulator ):
Android Delete AVD-N name
Eg, Android Delete AVD-N android2.1
 

7) display all android platforms in the system
Android list targets
 

8). Android list AVD
 

9), ADB Devices
 

10) view the software installed by the user
ADB Shell
CD/data/APP/
Ls
 

11) install software
ADB install D: \ abc.apk

12) uninstall the software
ADB Shell
CD/data/APP/
ADB uninstall <software Name>
ADB uninstall-k <software Name>
Note: If the-k parameter is added, the software is uninstalled but the configuration and cache files are retained. </B>
Eg, ADB uninstall com. ljq. Activity
 

13) Start ddms: ddms
 

14) Export files
ADB pull <remote path> <local path>
Eg, ADB pull/sdcard/hrtx/123.gif D :/
 

15) Import files
ADB push <local path> <remote path>
Eg, ADB pull D:/123.gif/sdcard/
 

16) enter the shell mode of the simulator:
ADB Shell
 

17) view log information in the command line:
ADB logcat
ADB logcat-s label name
Eg, ADB logcat-s mainactivity

18) delete system applications:
ADB remount (re-mount the system partition to make the system partition writable)
ADB Shell
CD/system/APP
RM *. APK
 

19) Obtain administrator permissions:
ADB Root
 

20) Start the activity
ADB shell am start-N package name/package name + class name (-N class name,-A action,-d date,-M mime-type,-C category, -E: extended data, etc)
Eg, ADB shell am start-N com. hrtx. Activity/COM. hrtx. activity. mainactivity
 

21) Release Port:
Set any port number as the request port from the host to the simulator or device.
Eg, ADB forward TCP: 5555 TCP: 8000
 

22) view the bug report:
ADB bugreport
 

23) record wireless communication logs:
Generally, there are a lot of wireless communication logs and there is no need to record them during running, but we can still set the record through the command:
ADB Shell
Logcat-B radio

24) obtain the device ID and serial number:
ADB get-Product
ADB get-serialno
 

25) access the database sqlite3
ADB Shell
Sqlite3

 

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.