Home > Android > Android Debug Bridge (adb): Useful commands – Notes

Android Debug Bridge (adb): Useful commands – Notes

  • Accessing an Android Device or Emulator […and getting Shell access]
 adb devices -l 
 adb -e 
 adb -e shell 

TThe -e directive initiates a connection to the Emulator, if there is only one emulator instance, otherwise it will throw an error

 adb -d 
 adb -d shell 

The -d directive initiates a connection to a Physical Android Device connected, if there is only one device connected, otherwise it will throw an error.

 adb -s <device_serial_identifier> 
 adb -s <device_serial_identifier> shell 

If there are multiple emulators, or multiple devices, or multiple of both connected, then the -s directive needs to be used to specify the specific “device/emulator” to connect to.

  • Installing and Uninstalling APKs
 adb -e install <APK_file_path> 
 adb -e uninstall <package_name> 
  • Errors when installing APKs:
    • INSTALL_FAILED_NO_MATCHING_ABIS
      • When the APK has native librariues that were built for a different architecture than what you are trying to run it on e.g. x86 and trying to run it on an ARM device, or built for ARM64 and trying to run it on ARM or x64; or ARM and trying to run it on x86 [1]
  • Getting ADB Root Permissions i.e. Root on the device
 adb root 
  • Listing packages (and file install locations)
 adb -e shell pm list packages -f 
 adb -d shell pm list packages -f 
  • Getting 3rd party packages only:
 adb shell pm list packages -f -3 

Sources:

[1] http://stackoverflow.com/questions/24572052/install-failed-no-matching-abis-when-install-apk

Advertisements
Categories: Android Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

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 )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: