DEV Community

Cover image for Flutter | Android Virtual Device - AVD in 8 steps
derva
derva

Posted on

Flutter | Android Virtual Device - AVD in 8 steps

Hi

Today we will discuss and I hope to learn how to make Android Virtual Device in Android Studio.

I assume that you have installed Android Studio on your machine/computer.

Step 1: Open Android Studio

Open your Android Studio and create New Flutter Project -> Flutter Application

After that click 'Finish' and wait a few seconds.
Then you will get a project, something like this.
(feel free to call your project as you want, and go to the directory lib->main.dart file)

Alt Text

Step 2: Android Virtual Device Manager

Now, go to drop-menu Tools and chose AVD Manager

Alt Text

Step 3: Create Virtual Device

You will get a pop-up window like this one and there go for "+ Create Virtual Device.." in the left down corner.

Alt Text

Step 4: Choose category and virtual device

Again you will get a new one pop-up window and now is to you to choose device definition

Alt Text

You have category:

  1. TV
  2. Phone
  3. WearOS
  4. Tablet
  5. Automotive

You probably need to choose the Phone category, but that depends on you and your project.

Go for the Phone category and choose one phone that you want.

Step 5: System Images

Now we need to choose System Image for our device.

Android System Images are just versions of Android that you can run on your computer. More about that

Download one of these System Images and click Next

Alt Text

Step 6: Android Virtual Device

Then, finish step you can change the name of your device.
For example: Nexus 5 API 30 - tutorial- but this isn't needed and you can leave just Nexus 5 API 30

Alt Text

Click Finish

Step 7: Launch Android Virtual Device

Now you can launch this AVD in the emulator. Click that. And it will show you a phone, maybe you need to wait for a few seconds but be patient. And if it's your first time to launch this AVD you maybe got some errors, if so please comment below which errors you get.

Alt Text

After you launch this AVD in the emulator, go to drop-menu and choose (mobile) and also choose main.dart

Alt Text

Last step: Run 'main.dart' (Shift+F10)

Run it. It can take a few seconds/minutes. Be patient. After that this main.dart code will be run on your virtual device.

Alt Text

That's it. After a few seconds, it will show you main.dart application on your virtual device. Congratulations.

Alt Text

Thanks for reading, I hope you learn something new. If you get any errors feel free to comment in the section below.

Also, if you can check my first post Say 'Hi' to Flutter

@derva

Top comments (0)