If you develop apps for Android devices and usually plug a device into your computer to test your apps, this may be a way to save time. Android Studio contains a feature for developers who want to test their apps on the latest API without using an actual device. It creates a virtual machine that will test your apps right on the screen of your PC. This tutorial will show you how to set up a virtual device for Android Pie 9.0.
What Is Android Studio?
Android Studio launched in 2014 and is the official Integrated Idea Development Environment for Android app development. It is available for download on Windows, macOS and Linux-based operating systems.
It allows you to enhance your productivity with features such as:
- A flexible Gradle-based build feature.
- A fast, feature-filled emulator.
- The ability to develop apps for all Android devices.
- A wide variety of testing tools and frameworks.
- C++ and NDK support.
Installing Android Studio on Your PC
There are quite a few lengthy times of installation and extraction of files in this process. You will need some time to complete the initial setup if you don’t already have the program installed.
Once the program fully installs, you are ready to add the Android Pie emulator so that you can build and test your apps all in one place.
1. Open the program. It will be in your Start Menu at the top with the recent programs.
2. Create a new Android Development project and enter the Development Environment.
3. Agree to the license policy to continue. Click Accept and then Next.
4. Wait for the files to extract before continuing.
5. When the download and extraction complete, click Finish.
Create the Virtual Device
To create an Android Pie virtual device for your testing, you first need to create a new Android Studio project. If you have previously used the program, you can also choose to open one you have already created. In that case, skip ahead to step five.
1. Click to add an activity.
2. Name the activity.
3. Click Finish.
4. Wait while the program builds your project.
5. Once it finishes, go to the Tools drop-down menu and select AVD Manager.
6. Click the Create Virtual Device button.
7. Choose a device from the list to emulate and click Next.
8. Create a new Virtual device for Android 9.0 Pie by clicking the Create Virtual Device button.
9. Choose a device to emulate.
10. Determine which version of Android you want to run and check to make sure the API Level category shows 28.
11. Click download and accept the license agreement.
12. Wait for the system image to download, then click Finish.
13. When the program returns to the System Image window, click Next.
14. The Verify configuration box will appear. Click Finish if everything looks correct.
You should now be ready to test your apps directly from the Android Studio app.
If you need to create another virtual device, when you open AVD Manager from the tools, you will see this box. The Create Virtual Device command is in the bottom-left corner.
This program does take some time to set up, but you should be able to save that and more time, whenever you need to run tests on your Android applications.
Our latest tutorials delivered straight to your inbox