ADB common commands

Source: Internet
Author: User

1.ADB devices View the currently connected devices;


2.ADB start-server open adb service;


3.ADB kill-server stop adb service;


4.ADB install-r (apk path)-R means if the APK is installed, reinstall the APK and keep the data and cache files.


5.ADB Uninstall (APK package name) Uninstall app but keep data and cache files;


6. List the package name

ADB shell PM List Packages lists the package names for all applications in the system;

ADB shell PM List packages-s Lists all package names for the system application;

ADB shell PM List packages-3 lists the third-party app package names in addition to the system application;


7. ADB shell pm Clear (apk package name) clears the app data and cache;


8.ADB Shell am start-n com.helloshan.demo/. Mianactivity start the application;


9. ADB shell am force-stop (APK package name) force stop the application;


10.ADB Remount re-mount the system partition to allow the system partition to be re-writable;

11. Remove the System application:

ADB shell

CD system/app/

Ls

RM *.apk

The LS command can view all files under a folder


12. Kill a Process:

ADB shell

PS is the view process command

Kill PID you want to end the process


13.pull and push files, requires ADB remount to get permission before operation

ADB push (file path) (the path you want to push)

ADB pull (file path) (Path to pull)


14.ADB remount Get file Read and Write permissions:


15.ADB Root Gain root privileges


16. View Logs

ADB logcat viewing logs

ADB logcat > Log.txt Save Log to File

ADB logcat-s "Activitymanager" "-S" option: Sets the label of the output log to display only that label


The log;


17.ADB Shell WM size View screen resolution


18. Common Operations Folder commands

ADB shell

CD System/app//Enter the specified folder within the system

LS//list displays the current folder contents

mkdir XXX//create folder for XXX

Rm-r XXX//Delete the folder with the name xxx and all the files inside it

RM XXX//delete file xxx

rmdir xxx//delete xxx folder

ADB common commands

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.