Home > Programming, QA, Test and Automation Stuffs, QA > Useful Adb commands for tests

Useful Adb commands for tests

  • Start and stop server to interact with the device:
adb start-server
adb kill-server
  • List of connected devices:
adb devices
  • Print the current log to the console:
adb logcat
  • Pull files from the device:
adb pull [device file location] [local file location]
  • Create a screenshot:
adb shell screencap -p /sdcard/screenshot.png
  • Create a video:
adb shell screenrecord /sdcard/Bug1234Video.mp4
  • Install/Uninstall apps:
adb install com.myAppPackage
adb uninstall com.myAppPackage
  • Send 10.000 random events on the real device. Use the parameter -s (seed) to execute the same commands over and over again:
adb shell monkey -p com.myAppPackage -v 10000 -s 100
  • Start an activity:
adb shell am start -a android.intent.action.VIEW
  • Open the shell:
adb shell
  • Remount the device with the right permissions:
adb remount
  • Remount, delete the app and reboot the tablet:
adb remount && adb shell rm /system/app/MyApp.apk && adb shell reboot

Thank you guys ! See you next week !

Resources: http://adventuresinqa.com/2016/04/19/powerful-adb-commands/

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: