ADB in Android Emulator

ADB stands for Android Debug Bridge.

It is used in Android application development environment. The generic syntax for ADB commands is given below. If the device is not specified, commands are sent to first attached device.

adb device_Identifier command

Here is the list of popular 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

More shell commands can be found here.

You may also like...