Popular adb commands

Here is the list of popular adb commands that can be used to send commands to apps on Android device.

Starting the app on Android device

adb shell am start -n com.android.calculator2/.Calculator

Listing all packages in the device

adb shell pm list packages

Listing only system packages in the device
adb shell pm list packages -s

Viewing the activity intents in the device

adb shell dumpsys activity intents

Viewing the activity broadcasts in the device
adb shell dumpsys activity broadcasts

Here is the list of more ADB commands.

  1. adb devices   : Command to view Android devices attached to computer
  2. adb install xyz.apk  : ommand to install Android app on Android Emulator
  3. adb pull /sdcard/abc.png  : command to pull files from Android emulator to machine
  4. adb shell input text ‘any text’  : command to enter value in text
  5. adb shell am start -a android.intent.action.VIEW : ADB Shell command to start the activity in Android Emulator
  6. adb shell pm list packages : How to print all packages within Emulator?
  7. adb shell pm uninstall com.example.MyApp : command to uninstall app in Android Emulator
  8. adb shell screencap /sdcard/screen.png  : Taking the screenshot
  9. adb shell screenrecord /sdcard/demo.mp4 : to record an Android Emulator screen. Recording can be stopped by pressing ctrl+c or we can also set the time limit
  10. adb shell ls /system/bin : To display all commands
  11. adb shell start avd1 : Command to start the device

You may also like...