(Appium + python) UI automation _10_adb commonly used commands

Foreword

adb (Android Debug Bridge) android-sdk tool in a tool, a command-line window is used by the computer terminal emulator or a real device interaction. In the app automated testing process sometimes has to use adb command, but every time Baidu feel very cumbersome, it is summed up under the app automated process several common adb commands.

adb commonly used commands

  • Get Device No.
$ adb devices 

 

  • Download apk

Premise: the need to download to your computer apk

$ Adb install <computer apk path> 
  • Uninstall apk
$ adb uninstall <apk包名>
  • View apk package name & activity

  (1) adb command View (premise: the target app equipment has been installed)

    Real machine / simulator view of the need to open the app-> input terminal installation command adb logcat | find "START"

  (2) View apk package name by aapt (premise: aapt environment has been configured to download the apk to your computer)

$ Aapt dump badging <computer apk path>

  • Save app logs
$ Adb logcat | find "package name"> path (path computer to save the log)
  • Transfer files
# Send computer files to the phone 
adb push <computer path> <path phone> # Send phone files to your computer 
adb pull <path phone> <computer path>

  • Kill / adb reboot process
# Kill adb process 
$ adb kill- Server 

# start adb process 
$ adb start-server
  •  Specifies the device operation
# Specified device (computer when connecting multiple devices, are required for the device) 
$ the adb -s <equipment number> <any operator> # Example mounting device specified APK 
$ the adb -s <equipment number> install <apk path>

 

Guess you like

Origin www.cnblogs.com/mini-monkey/p/11962217.html