Install an apk file from command prompt?
You can use the code below to install application from command line
adb install example.apk
this apk is installed in the internal memory of current opened emulator.
adb install -s example.apk
this apk is installed in the sd-card of current opened emulator.
You can also install an apk to specific device in connected device list to the adb.
adb -s emulator-5554 install myapp.apk
Refer also to adb help for other options.
How do you install an APK file in the Android emulator?
You can simply drag and drop the .apk file of your application to the emulator and it will automatically start installing.
Another option:
Windows:
- Execute the emulator (SDK Manager.exe->Tools->Manage AVDs...->New then Start)
- Start the console (Windows XP), Run -> type cmd, and move to the platform-tools folder of SDK directory.
- Paste the APK file in the 'android-sdk\tools' or 'platform-tools' folder.
- Then type the following command.
adb install [.apk path]
Example:
adb install C:\Users\Name\MyProject\build\Jorgesys.apk
Linux:
- Copy the apk file to
platform-tools
in theandroid-sdk linux
folder. - Open Terminal and navigate to platform-tools folder in android-sdk.
- Then Execute this command -
./adb install FileName.apk
- If the operation is successful (the result is displayed on the screen), then you will find your file in the launcher of your emulator.
Mac:
PATH=$PATH:~/Library/Android/sdk/platform-tools
Example : PATH=$PATH:/users/jorgesys/eclipse/android-sdk-mac_64/tools
Then run adb.
Mac:
1.Run the emulator,
2.then copy your .apk file and paste into /Users/your_system_username/Library/Android/sdk/platform-tools
,
if you are not able to find sdk path in your mac system, do the following steps: Open finder->select
Go option on top menu -> select Go to Folder option -> it will popup a window with a textfield: /Users/your_system_username/Library/Android/sdk/
-> now open platform-tools folder and paste your copied .apk file,
Now open the terminal and type the following:
cd Library/Android/sdk/platform-tools
execute the following in your terminal:
./adb install yourapkfilename.apk
if you get the following error message:error: no devices found - waiting for device
, follow step 5.Run your emulator from Android Studio, once emulator active then repeat step 4, you will see the success message on your terminal.
I can't Install Apk from android app bundle using command prompt
As a precondition remember to create an environment variable "ANDROID_HOME" and set it to where the Android SDK is located on your Development machine.
So for Windows it may be
ANDROID_HOME = "C:/MyAndroid"
Assuming you are testing on just one device first generate the bundle only for your connected device using the following.
bundletool build-apks --connected-device --bundle="\somepath\app-release.aab" --output="\somepath\release.apks" --ks="somepath\keystore" --ks-pass=pass:cleartextpasswd --ks-key-alias=keyalias --key-pass=pass:cleartextpasswd
Note the use of the option
--connected-device
Now to install on a specific device use the following command:
bundletool install-apks --apks="somefolder\release.apks"
--device-id="yourdeviceidstring"
Get the device id string from the Settings section of your device.
How to build .apk file from Windows command-line?
You can do it in command line (.bat) in windows using ant.
with:
"ant release"
You build the apk unsigned.
Then you need to add the call to "jarsigner" and "zipalign" in the bat to complete the task.
You can find an example of the command line to call these tools here:
http://developer.android.com/guide/publishing/app-signing.html#signapp
Best,
How to install multiple android applications ( from apk files) into device?
I found the solution. Its actually very simple:
adb install application1.apk & adb install application2.apk & adb install applicaiton3
That's what i was looking for.
Thanks everyone
Cannot install android apk to emulator from command prompt
adb.exe
is not in your system's path, so cmd
cannot find it.
It is located in \...\adt-bundle-windows-x86-20140624\sdk\
platform-tools>, not in \...\adt-bundle-windows-x86_64-20140624\sdk\
tools
Related Topics
How to Get an Android Wakelock to Work
Get the Uri of an Image Stored in Drawable
Incompatibleclasschangeerror After Updating to Android Build Tools 25.1.6 Gcm/Fcm
Cursor Size Limit in Android SQLitedatabase
Webview, Add Local .CSS File to an HTML Page
Dialog to Pick Image from Gallery or from Camera
Background-Attachment:Fixed Not Working - Android Chrome (V40)
Error:'Keytool' Is Not Recognized as an Internal or External Command, Operable Program or Batch File
How to Add an Image on Edittext
Should Have Subtitle Controller Already Set Mediaplayer Error Android
How to Turn On/Off Wifi Hotspot Programmatically in Android 8.0 (Oreo)
Generate Bitmap from HTML in Android
Is There a Real Solution to Debug Cordova Apps
Android Failed to Load Js Bundle
Detect the Status of Two Sim Cards in a Dual-Sim Android Phone