Common commands and explanations of ADB

Source: Internet
Author: User

    1. Display all devices in the system:
      ADB devices
      This command is to view the currently connected device, the Android device connected to the computer, or the emulator will list the display

      2. Open the ADB service:
      ADB start-server

      3. Close the ADB service:
      ADB kill-server
      Stop ADB Service

      4. Connect the device:
      ADB Connect 192.168.1.61
      If the USB connection is connected directly to ADB, if you want to connect over the network (wired or wireless), you need to connect via IP on the same LAN. Above 192.168.1.61 replace Chengxiang to connect the IP of the device.

      5. Disconnect the device:
      ADB disconnect 192.168.1.61

      6. Install an APK
      ADB install-r (apk path)
      -R means if the APK is installed, reinstall the APK and keep the data and cache files. APK path can directly drag the apk file into the cmd window, remember to add a space.

      7. Direct Uninstall:
      ADB Uninstall (APK package name)
      Uninstall the app but keep the data and cache files:
      ADB uninstall-k (APK package name)

      8. List the package names of all apps installed on your phone:
      ADB shell PM List Packages

      List all package names for the system app:
      ADB shell PM List packages-s

      List third-party app package names in addition to system apps:
      ADB shell PM List packages-3

      9. Clear the app data and cache:
      ADB shell pm Clear (apk package name)

      10. Launch the App
      ADB shell am start-n com.helloshan.demo/. Mianactivity
      There is no diagram here, you need to know the specific software package name and access to open.

      11. Force Stop Application
      To force stop the app, execute the following command:
      ADB shell am force-stop (APK package name)

      12. Remove the System application:
      ADB remount (re-mount the system partition so that the system partition is re-writable).
      ADB shell
      CD system/app/
      Ls
      RM *.apk
      The LS command can view all files under a folder


      12. Kill a Process: (three steps)
      ADB shell
      Ps
      Kill PID
      PS is the view process command, kill PID you want to end the process

      13.pull and push files
      ADB push (file path) (the path you want to push)

      ADB pull (file path) (Path to pull)

      Before ADB push/pull some devices to get permission first, 14 article explained.

      14. Get read and write access to the file:
      ADB remount
      Some devices do not direct ADB remount, must first enter as root, first execute ADB root, in the execution of ADB remount

      15. View the log:
      ADB logcat

      16. View screen resolution
      ADB shell WM Size

      17. Common Operations Folder commands
      Operating files and folders sometimes appear with insufficient permissions, read-only the file system. You need the ADB remount operation to get permissions.
      CD System/sd/data//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

Common commands and explanations of ADB

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.