When running an Android Studio emulator, you can install APK files directly. Here are the steps to install APK file in the Android emulator.
If you don’t have Play Store installed in your emulator, it can be pretty hard to install apps. Of course, if you are developing an app with Android Studio, you can run it directly from the Studio itself. However, if you want to install your favorite app or test a third-party app in the emulator, you have to install it via the APK. This is especially true if your emulator doesn’t have Play Store installed or if the app itself is not available via the Play Store. For example, recently I wanted to try an app that is blocked in the Play Store in a safe environment. So, I downloaded the apk file, installed apk in the Android emulator, and run it there. Though the app is garbage, it satisfied my curiosity.
It’s not obvious at first glance, but the Android Studio emulator gives you two ways to install an APK file. I will show those two methods. Follow the one you like.
Without further ado, let me guide you through the steps to install APK file in Android emulator.
Drag and drop to install APK file in Android Studio Emulator
To install apk file, just drag and drop the file on the emulator. Android will automatically install the apk. For more guidance, follow the below steps.
1. Open Android Studio
The first thing you need to do is open the Android Studio. To do that, double-click on the desktop icon or search for it in the Start menu.
2. Open the AVD manager in Android Studio
Next, open the AVD manager by clicking on the “Configure → AVD Manager” option in the Android Studio main screen.
3. Launch the emulator from AVD manager
In the AVD manager, click on the “Play” button next to the emulator. This action will open the Android emulator. If you don’t have an emulator in the AVD Manager, create one by clicking on the “Create virtual device” button.
4. Drag and drop APK file in emulator
After opening the Android emulator, drag and drop the APK file in the emulator. As soon as you do that, the emulator will recognize the APK and installs it automatically.
Once the app has been installed, you can launch it from the app drawer. Keep in mind that once the app has been installed, you might not see it on the home screen. That is the reason why you need to go to the app drawer to find the newly installed app. Of course, this completely depends on the launcher you are using in the emulator.
ADB command to install APK in Android Studio Emulator
When the Android emulator is actively running, you can also use the ADB command to install an apk file in the emulator. This is very helpful if you want to execute additional commands or create your own script. So, here’s how you can install APK files in the emulator with the ADB command.
Before proceeding, make sure you know the Android SDK location and the APK file location on your hard drive. Since we are executing a command, both these location paths are important.
1. First, open the Android Studio and click on “Configure → AVD Manager” to launch the AVD manager.
2. Here, click on the “Play” button next to the emulator to start it.
3. Once you have the emulator running, open a command window. In Windows, you can do that by searching for “CMD” in the Start menu.
4. In the command line window, execute the below commands one after the other. Replace the dummy SDK path and APK path with the actual Android SDK path and APK file path.
adb install "c:\path\to\app.apk"
As soon as you execute the command, ADB will install the APK file in the running Android emulator. Once installed, you will see the “Success” message. You can open the newly installed app from the app drawer in the emulator.
That is all. I hope that helps. I hope that helps. If you need any help, comment below and I will try to help as much as possible.