How do you install an apk on the emulator in Android Studio from the terminal?
In Eclipse we did
/home/pcname/android-sdks/platform-tools/adb -s emulator-5554 install /home/pcname/Downloads/apkname.apk
Now how about in Android Studio?
This question is related to
android
android-studio
1.Install Android studio. 2.Launch AVD Manager 3.Verify environment variable in set properly based on OS(.bash_profile in mac and environment Variable in windows) 4. launch emulator 5. verify via adb devices command. 6.use adb install apkFileName.apk
Drag and drop apk if the emulator is launched from Android Studio. If the emulator is started from command line, drag and drop doesn't work, but @Tarek K. Ajaj instructions (above) work.
Note: Installed app won't automatically appear on the home screen, it is in the apps container - the dotted grid icon. It can be dragged from there to the home screen.
For those using Mac and you get a command not found error, what you need to do is
type
./adb install "yourapk.apk"
In Android Studio: View
- Tool Windows
- Gradle
In the Gradle tool window navigate to your :app
- Tasks
- install
and then execute (by double-clicking): any of your install*
tasks: e.g. installDebug
, installRelease
Note: the apk will also automatically installed when you Run your application
Run simulator -> drag and drop yourApp.apk into simulator screen. Thats all. No commands.
Start your Emulator from Android Studio Tools->Android-> AVD Manager
then select an emulator image and start it.
After emulator is started just drag and drop the APK Very simple.
Much easier is just to start your emulator, then go to sdk/platform-tools and use adb from there to install apk. Like:
adb install xxx.apk
It will install it on running emulator.
For Linux: once emulator is running, the following worked for me.
Because I installed the Android SDK on my home directory, I have the following file structure:
home/Android/Sdk/platform-tools/adb
home/AndroidStudioProjects/Metronome.adk
AndroidStudioProjects is a file folder I made for my Android projects. "Metronome.adk" is the file I want to run.
So, using Terminal from the home directory...
./Android/Sdk/platform-tools/adb install ./AndroidStudioProjects/Metronome.adk
Being a Linux novice, I often forget the need to put the "./" in when trying to locate a file or run a command.
After the command achieves "Success", the app is in the Apps area of the emulator and can be run.
In android studio emulator to run an apk file just drag the apk into the emulator.The emulator will install the apk
Just drag APK file to android emulator it will install automatically.
Just download the apk from talkback website
Drag the downloaded apk to the started emulator, Go to settings on emulator > Search for talkback, you will now find it there
Source: Stackoverflow.com