*Important* TOP 5 ADB Commands

Below is the list of ADB commands very important during mobile application testing.

  1. ADB command to list of devices connected.

    adb devices

Description: Prints a list of all attached emulator/devices.

Ex:

e4b25377        device
emulator-5554  device

2.  ADB command to Install the .apk file on the Android device.

           adb install sample.apk

Description: Prints a list of all attached emulator/devices.

Other Varieties of Install .apk file command.

adb install -l sample.apk =>forward lock application
adb install -r sample.apk =>replace existing application
adb install -t sample.apk =>allow test packages
adb install -s sample.apk =>install the application on sdcard
adb install -d sample.apk =>allow version code downgrade
adb install -p sample.apk =>partial application install

3.  ADB command to Uninstall the .apk file on the Android device.

adb uninstall [options] <PACKAGE>

Description: Removes a package from the emulator/device.

adb uninstall com.test.app
adb uninstall -k com.test.app => Keep the data and cache directories around after package removal.

4.  ADB command to copying the file from emulator/device to the destination computer.

             adb pull <Device Directory> [Computer Directory]

       Description: Download a specified file from an emulator/device to your computer.

adb pull /sdcard/demo.mp4 e:\sample-folder

5.  ADB command to copying the file from destination computer emulator/device.

adb push [Computer Directory] <Device Directory>

Description: Upload a specified file from your computer to an emulator/device.

adb push  E:\sample-folder\abc.txt /sdcard/foldername

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: