page.title=Running Your App parent.title=Building Your First App parent.link=index.html trainingnavtop=true page.tags=emulator @jd:body
In the previous lesson, you created an Android project that displays "Hello World." You can now run the app on a real device or on an emulator. If you don't have a real device available, skip to Run on an Emulator.
Set up your device as follows:
Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.
Run the app from Android Studio as follows:
Android Studio installs the app on your connected device and starts it.
Before you run your app on an emulator, you need to create an Android Virtual Device (AVD) definition. An AVD definition defines the characteristics of an Android phone, tablet, Android Wear, or Android TV device that you want to simulate in the Android Emulator.
Create an AVD Definition as follows:
If you don't have a particular system image installed, you can get it by clicking the download link.
For more information about using AVDs, see Create and Manage Virtual Devices.
Run the app from Android Studio as follows:
It can take a few minutes for the emulator to start. You may have to unlock the screen. When you do, My First App appears on the emulator screen.
That's how you build and run your Android app on the emulator! To start developing, continue to the next lesson.