Skip to content

Most visited

Recently visited

navigation

Run Your App

This lesson teaches you to

  1. Run on a real device
  2. Run on an emulator

In the previous lesson, you created an Android project that displays "Hello World." You can now run the app on a real device or an emulator.

Run on a real device

Set up your device as follows:

  1. Connect your device to your development machine with a USB cable. If you're developing on Windows, you might need to install the appropriate USB driver for your device.
  2. Enable USB debugging in the Developer options as follows.

    First, you must enable the developer options:

    1. Open the Settings app.
    2. (Only on Android 8.0 or higher) Select System.
    3. Scroll to the bottom and select About phone.
    4. Scroll to the bottom and tap Build number 7 times.
    5. Return to the previous screen to find Developer options near the bottom.

    Open Developer options, and then scroll down to find and enable USB debugging.

Run the app on your device as follows:

  1. In Android Studio, click the app module in the Project window and then select Run > Run (or click Run in the toolbar).
  2. In the Select Deployment Target window, select your device, and click OK.

Android Studio installs the app on your connected device and starts it.

That's "hello world" running on your device! To start developing, continue to the next lesson.

Run on an emulator

Run the app on an emulator as follows:

  1. In Android Studio, click the app module in the Project window and then select Run > Run (or click Run in the toolbar).
  2. In the Select Deployment Target window, click Create New Virtual Device.
  3. In the Select Hardware screen, select a phone device, such as Pixel, and then click Next.
  4. In the System Image screen, select the version with the highest API level. If you don't have that version installed, a Download link is shown, so click that and complete the download.
  5. Click Next.
  6. On the Android Virtual Device (AVD) screen, leave all the settings alone and click Finish.
  7. Back in the Select Deployment Target dialog, select the device you just created and click OK.

Android Studio installs the app on the emulator and starts it.

That's "hello world" running on the emulator! To start developing, continue to the next lesson.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)