adb in android emulatorADB 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.
Here is the list of popular ADB commands.
adb device_Identifier command
- 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
Web development and Automation testing