adb install command installs the application in emulator. Following are the options available with adb install command
adb install [-l] [-r] [-s]
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
Now to install in Windows Machine proceed with following steps.
Install Android SDK
- Start your Emulator. (Mostly in C:\adt\sdk\tools\emulator.exe)
- Start Command Prompt (Windows + R type cmd )
- Go to your platform-tools directory e.g. cd C:\adt\sdk\platform-tools
- Paste the APK file in the ‘android-sdk\platform-tools’ folder
- Run following command.
.
adb install [apk file name]
Example
adb -e install -r yourapp.apk
Linux :
- Open Terminal
- Go to the platform-tools folder
cd /home/android-sdk/platform-tools - install apk from follwing command
./adb install [apk file name]
Example
./adb install yourapp.apk
Mac:
- PATH=$PATH:”adb location”
- Example : PATH=$PATH:/users/jorgesys/eclipse/android-sdk-mac_64/tools
- Then run adb.
- in every machine you’ll get output as
1056 KB/s (328795 bytes in 0.302s)
pkg: /data/local/tmp/yourapp.apk
Success
While from eclipse you can directly run with emulator which will ultimately install application in your emulator.