Installing an android app in the emulator
If you try to install an android app ( .apk file) in the android emulator, it should not be a problem, when doing so with a vanilla install of the android SDK.
Here’s a fine walkthrough
However, if you’ve been developing for various android SDK versions, you’ll have defined multiple AVD’s (Android Virtual Devices) to test your stuff and when trying to install an .apk file with:
adb install path/to/<filename>.apk
ADB (Android Debug Bridge) will be complaining about not having specified which AVD to install it on.
The solution is to first start the emulator with the AVD you wish to use
emulator -avd <AVD name>
With <AVD name> being the same name you gave to that specific AVD in the ‘Android SDK and AVD Manager’.
Next, when the device is running, you need to tell the ADB to install the .apk file specifically for the emulator instance.
You can get a list of currently running AVD’s with
In my case it returned
List of devices attached
Now, to install the .apk file specifically for that AVD instance you have to specify it with the -s option
adb -s emulator-5554 install /path/to/<filename>.apk
Now it should install w/o any problems