Install Apps in Android using ADB command line

This is a quick post on how to install applications (.apk) on your Android device using the ADB (Android Debugging Bridge) command line utility.

Please note that this post is not intended to be a complete reference (neither a beginner tutorial) on adb. While writing my Android apps I usually have my emulator as well as my Android device (Nexus One) connected to my computer to see how the application layout is coming along. In case of multiple devices connected ( along with the emulator), simply “abd install pathToAPK.apk” will complain you that multiple devices are connected.

ADB provides the below command line option to direct apk to a particular device (emulator or your android device).

First do adb devices to see which all Android devices are connected to your computer.

C:\ adb devices <Enter>List of devices attached
emulator-5554   device
192.168.1.117:5555 device

Now I know which all devices are connected and where I need to direct/send my apk. Use “–s” option to specify the serial number (the first column in above output) of the device (unique identifier of each device) and “-r” option to reinstall (ignore –r if you are doing a fresh install of the application on the device)

adb -s 192.168.1.117:5555 install -r application.apk <Enter>

Hope this helps somebody like me :)

Keep coding for the cute little Android…!

Tip: Check out adbWireless app on Android Market for wireless and hasslefree connection to your device.

About these ads

2 thoughts on “Install Apps in Android using ADB command line

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