Partager via


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

clip_image001

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

clip_image002

a. Download and install Windows x64 version

clip_image003

3. Download and install Android Studio for Windows x64 - https://developer.android.com/studio/index.html

clip_image004

clip_image005

a. Make sure to check them all:

clip_image006

Note: It could take up to 30 minutes or more to finish the installation

b. Start Android Studio

clip_image007

4. On Welcome screen, click Next

clip_image008

a. Select Custom

clip_image009

b. Select All options

clip_image010

Note: If you decide to change the installation path, make sure there are no empty spaces in it

c. Click on Next

clip_image011

d. Wait for installation to finish

clip_image012

e. Note down the name of Android virtual device and click on Finish

clip_image013

5. Click on Configure - SDK Manager

clip_image015

a. Select Android SDK - SDK Tools. Make sure Intel x86 Emulator Accelerator (HAXM installer) is installed

clip_image016

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

clip_image017

You should now see the emulator running

clip_image019

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.

clip_image018

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

clip_image020

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 ;)