Test On Virtual Devices (Windows/Mac)

To emulate physical devices, you can use Android Studio emulator to create virtual devices. When Android Studio was installed it created a virtual device using the latest version of Android by default. You can use the Android Virtual Device (AVD) Manage to SEE what virtual devices you currently have or CREATE new ones.

  1. To view virtual device(s), go to Tools > Android > AVD Manager or click on the AVD Manager icon ) at the top of the screen.
  2. In the Your Virtual Devices window that appears, you will see a default device (e.g., Nexus) listed and any other virtual devices that you have created earlier.


  3. (Optional) If you want to start with a fresh copy of a virtual device, select it and then click on the down arrow on the right and select Wide Data and in the Confirm Data Wipe dialog box that appears, click the Yes button.

To run virtual device,

  1. Click the Start button icon (  ) the right side of the screen.
    NOTE: It may take a while for the AVD to load. When you click the Play button, Android Studio will start Gradle-build and then prompt you to select a virtual or real device from the list.
  2. If you see the Welcome message, press GOT IT. If you want to get rid of these notification, swipe down and then swipe right for each notifications.
  3. Once the virtual device is up and running, drag the lock icon upward to unlock the device.
  4. Click the icon to show all of your apps.


  5. Click the home button to go back to the home screen.


  6. Return to Android Studio and press SHIFT+F10 or click the Run button ) at the top of the screen.
  7. In the Choose a running device dialog box that appears, select a device.
  8. Click the OK button.
  9. Click ALT+TAB on Windows, or CMD+TAB on MAC to bring device to the front of the screen and then you should see your app on your device.
    TIP: To toggle the orientation from portrait to landscape and back again, click the CTRL+F11 on the PC or Mac. It is also good practice to keep the device open, change the code and then run again to avoid having to wait for the virtual device to open again.

New Features in Android Studio Emulator 2.0

(Optional) Create New Virtual Device

You can create as many virtual devices as you need to test your app to emulate physical (real) devices.

  1. Close any existing virtual devices to free up memory.
  2. Open the AVD Manager by selecting Tools > Android > AVD Manager or click on the AVD Manager icon (  ) at the top of the screen.
  3. Click the Create Virtual Device button at the bottom of the window (See screenshot above).
    NOTE: You can choose from any of the form factor (TV, Phone, Tablet, Wear and Glasses) to create a device.
  4. From the category list on the left side of the window, choose a form factor (e.g., Phone)
  5. Select a target device from the list (e.g., Nexus 6),
  6. (Optional) Click the New Hardware Profile button if you want to make any changes and then click the OK button.
    ALTERNATIVE: You can click the Clone Device... button and then make necessary changes to create a new virtual device.
  7. Click the Next button.


  8. In the System Image dialog box that appears select a system image (Android version) (e.g., Marshmallow).


  9. Click the Next button.
  10. (Optional) In the Verify Configuration dialog box that appears, if you have enough memory, click the Show Advanced Settings button and scroll down and reduce the amount of RAM (e.g., 1G) that the device uses so the multiple devices can run at the same time.
    EXAMPLE: If you have a lot of memory, you may want to set HAXM to 3G and each AVD to 1G. It is also a good idea to increase the VM-Heap to 256 to avoid errors with some apps and check the Enable Keyboard input checkbox to allow typing with computer's keyboard instead of on-screen virtual device keyboard.


  11. Click the Finish button to create the device.
  12. Close the AVD manager and all other virtual devices and then click on the Run button at the top of the screen to run the app.
    NOTE: Notice this time you are starting the app not the device first.
  13. In the Choose Device dialog box that appears, choose Launch Emulator radio button instead of Choose running device radio button, then choose a new device from the drop-down list and then click the OK button.
    NOTE: You should see the run window and the console panel and then the device should start up.
  14. When the lock screen appears, drag the lock icon upward.
  15. CHECK POINT: Click the OK button to any messages you see and the app should appear.

(Optional) To run on more than one device:

  1. Click the Back button on the device to return to the home screen.
  2. Return to Android Studio and open the AVD manager and choose another virtual device (e.g., Nexus 5) and click the Start button.
  3. Repeat step 2 for as many devices as you need.
  4. Arrange devices on the screen by dragging them next to each other.
  5. Once the lock screen appears on the other devices,drag the lock icon upward.
  6. Return back to Android Studio and click the Run button again.
  7. To run the app simultaneously on two or more devices, hold down the SHIFT key and click to select multiple devices and then click the OK button.
  8. CHECK POINT: Go back to the two devices to see the app runs on all devices.