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.
- adb devices : Command to view Android devices attached to computer
- adb install xyz.apk : ommand to install Android app on Android Emulator
- adb pull /sdcard/abc.png : command to pull files from Android emulator to machine
- adb shell input text ‘any text’ : command to enter value in text
- adb shell am start -a android.intent.action.VIEW : ADB Shell command to start the activity in Android Emulator
- adb shell pm list packages : How to print all packages within Emulator?
- adb shell pm uninstall com.example.MyApp : command to uninstall app in Android Emulator
- adb shell screencap /sdcard/screen.png : Taking the screenshot
- 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
- adb shell ls /system/bin : To display all commands
- adb shell start avd1 : Command to start the device