Android adb shell commands

Source: Internet
Author: User

1. display all Android platforms in the system:

Android list targets

2. Display All AVD (simulators) in the system ):

Android list avd

3. Create an AVD (simulator ):

Android create avd -- name -- target Platform ID

4. Start the simulator:

Emulator-avd name-sdcard ~ /Name. img (-skin 1280x800)

5. Delete AVD (simulator ):

Android delete avd -- name

6. Create an SDCard:

Mksdcard 1024 M ~ /Name. img

7. AVD (simulator) Location:

Linux (~ /. Android/avd) Windows (C: \ Documents ents and Settings \ Administrator \. android \ avd)

8. Start DDMS:

Ddms

9. display all currently running simulators:

Adb devices

10. Run the following command on a simulator:

Abd-s simulator serial number command

11. Install the application:

Adb install-r application .apk

12. Get the files in the simulator:

Adb pull <remote> <local>

13. Write a file to the simulator:

Adb push <local> <remote>

14. Enter the shell mode of the simulator:

Adb shell

15. Start the SDK, documentation, and instance Download Manager:

Android

16. Upload the apk package:

Adb shell

Cd data/app

Rm apk package

Exit

Adb uninstall apk package MAIN package name

Adb install-r apk package

17. view the adb Command help information:

Adb help

18. view LOG information in the command line:

Adb logcat-s label name

19. The commands followed by the adb shell mainly come from:

Source code \ system \ core \ toolbox directory and source code \ frameworks \ base \ cmds directory.

20. delete system applications:

Adb remount (re-mount the system partition to make the system partition writable ).

Adb shell

Cd system/app

Rm *. apk

21. Get administrator permissions:

Adb root

22. Start 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 ).

23. Release Port:

You can set any port number as the request port from the host to the simulator or device. For example:
Adb forward tcp: 5555 tcp: 8000

24. copy a file:

You can copy files to or from a device,
Copy a file or directory to the device or simulator:
Adb push <source> <destination> </source>
Example: adb push test.txt/tmp/test.txt
Copy a file or directory from a device or simulator:
Adb pull <source> <destination> </source>
For example, adb pull/addroid/lib/libwebcore. so.

25. Search for simulator/device instances:

Obtain the list of running Simulators/devices and the status of each instance:
Adb devices

26. view the bug report:
Adb bugreport
27. Record wireless communication logs:

In general, there are a lot of wireless communication logs and there is no need to record them during operation, but we can still set the record through the command:
Adb shell
Logcat-B radio

28. Obtain the device ID and serial number:

Adb get-product
Adb get-serialno

29. Access the database SQLite3

Adb shell
Sqlite3

# Cd system/sd/data // enter the specified folder in the system
# Ls // the contents of the current folder are displayed in the list
# Rm-r xxx // delete a folder named xxx and all its files
# Rm xxx // delete file xxx
# Rmdir xxx // Delete the xxx folder

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.