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
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.