How to Setup Android Emulator using Android Studio
~ Karan Rustagi
Alright, it’s been a while since i posted anything here and have been thinking about my comeback post. Today, i had to reproduce an issue on an older version of Android OS but couldn’t find a physical device so decided to try Android emulator instead. The process is much simpler than i thought. If you ever find yourselves in a similar situation, feel free to to use the instructions below.
1. Start by ensuring Hyper-V -> Hyper-V Platform -> Hyper-V Hypervisor is NOT installed. Your CPU should still support VT-x feature for HAXM to work
2. Install the latest Java Platform JDK. If you don’t have it, install the Java SE from https://www.oracle.com/technetwork/java/javase/downloads/index.html
a. Download and install Windows x64 version
3. Download and install Android Studio for Windows x64 - https://developer.android.com/studio/index.html
a. Make sure to check them all:
Note: It could take up to 30 minutes or more to finish the installation
b. Start Android Studio
4. On Welcome screen, click Next
a. Select Custom
b. Select All options
Note: If you decide to change the installation path, make sure there are no empty spaces in it
c. Click on Next
d. Wait for installation to finish
e. Note down the name of Android virtual device and click on Finish
5. Click on Configure - SDK Manager
a. Select Android SDK - SDK Tools. Make sure Intel x86 Emulator Accelerator (HAXM installer) is installed
6. Open CMD as Administrator. Run following command to start the emulator using the name you copied in step 4.e
emulator.exe -avd Nexus_5X_API_26_x86
You should now see the emulator running
a. To see the list of installed virtual devices, type Emulator.exe -list-avds. Alternatively, you can also use Android Virtual Device Manager to manage and launch virtual devices.
Note: I had to disable both Hyper-V and Credential Guard from inside the OS for HAXM to work. You can disable Credential Guard by running following command
Error: This computer does not support Intel Virtualization Technology
DG_Readiness_Tool_v3.2.ps1 –Disable
You will now be prompted to reboot the PC. Press F3 or Windows key at both screens during the reboot.
Download link: https://www.microsoft.com/en-us/download/details.aspx?id=53337
7. Download and install Company Portal from here - https://www.microsoft.com/en-us/download/details.aspx?id=49140
Comments
- Anonymous
August 18, 2017
Any tips on how to install the Google Play Store in an emulator? - Anonymous
August 22, 2017
Great post, thanks for writing ;)