Here are the 2 Steps to Create and Launch the Android Virtual Device. This post contains the way to create Android Virtual Device / Emulator and Different ways to launch the Emulator.
To run your React Native Android app you will need an Android device. There are two ways to have an Android environment to test your app:
- A Physical Android Device.
- An Android Virtual Device, which allows you to emulate an Android device on your computer.
Before preparing the virtual device you should set up the Android development environment for that if you already did that then you can proceed to the next step but if haven’t done that then you can see Installation of Android Studio and Setting up Android Development Environment which will help you to do so.
1. Using a Physical Device
If you have a physical Android device, you can use it for development in place of an AVD by plugging it into your computer using a USB cable and following the instructions here.
2. Using a Virtual Device
You can see the list of available Android Virtual Devices (AVDs) by opening the “AVD Manager” from within Android Studio. Look for an icon that looks like this: If you have just installed Android Studio, you will likely need to create a new AVD. Select “Create Virtual Device”, then pick any Phone from the list and click “Next”.
Select the “x86 Images” tab -> then look for the Marshmallow API Level 23, x86_64 ABI image with an Android 6.0 (Google APIs) target.
If you don’t have HAXM installed, click on “Install HAXM” or follow these instructions to set it up, then go back to the AVD Manager.
Click “Next” then “Finish” to create your AVD. Now click on the green triangle button next to your AVD to launch it.
Launch Virtual Device from the terminal
To launch the virtual device from the terminal without opening the android studio, again and again, you need to go to the SDK directory and then to Sdk\tools\bin default path is here C:\Users\Admin\AppData\Local\A
C:\Users\Admin>cd C:\Users\Admin\AppData\Local\Android\Sdk\tools\bin
This will take you to SDK > tool > bin directory
C:\Users\Admin\AppData\Local\Android\Sdk\tools\bin>avdmanager list avd
Lists all the AVD devices that you have created in the above post.
C:\Users\Admin\AppData\Local\Android\Sdk\tools\bin>cd ..
Will take you to the parent directory
C:\Users\Admin\AppData\Local\Android\Sdk\tools>emulator -avd <You device name>
This is how you can Create and Launch the Android Virtual Device.
If you are facing any problem or if you have any doubt about the topic you can comment below or contact us here.
Hope you liked it 🙂
It worked. Thanks