This page describes how to set up a development environment for Android Instant Apps onto a Linux, macOS, or Windows development machine.
Check your system requirements
To develop an instant app, you need the following:
- A development machine running Linux, macOS, or Windows.
- JDK 1.8
- Android Studio 3.0 or higher
- An environment variable called
ANDROID_HOMEthat points to the location of the Android SDK on your development machine.
In Android Studio, use the Android SDK Manager to install the following packages:
- Android SDK 6.0 or higher
- Android SDK Build Tools 26.x or higher
- Android SDK Tools 25.x or higher
- Android SDK Platform Tools 25.x or higher
- Android Support Library (latest)
- Android Repository (latest)
Install the Instant Apps Development SDK
- Go to Tools > Android > SDK Manager to open the Android SDK Manager.
- Click the SDK Tools tab.
- From the list, select Instant Apps Development SDK.
- Click Apply.
- After the Component Installer completes the installation, click Finish.
For more information about using the Android SDK Manager, see Android SDK Tool Updates.
Set up your device or emulator
You can develop instant apps on the following devices and emulators:
Devices: Most Android devices running Android 5.1 (API level 21) or higher.
Emulator: Nexus 5X image running Android 5.1 (API level 21) or higher, x86, with Google APIs. Create the emulator as described in Create and Manage Virtual Devices. Make sure you use the Google Play Store device profile.
To setup your device or emulator, follow these instructions:
Go to Accounts > Google to log on to a Google account on the device or emulator. You can use a test account for this purpose.
If your device or emulator is running Android 7.1.1 (API level 25) or lower, Android Studio installs or updates the following when you first run an instant app.
- Google Play Services - Update your Google Play Services. To do this, click the three dots on the emulator control, open the Google Play tab, and then click Update.
- Google Play for Services for Instant Apps - The instant apps runtime.
- Instant Apps Development Manager - A developer tool that lets you locally install and launch instant apps from your workstation (without deploying to Google Play).
To confirm the configuration settings on devices running Android 7.1.1 (API level 25) or lower, open the Settings app, and navigate to Apps > Google Play Services for Instant Apps. You can also run the command
adb shell pm list packages | grep "com.google.android.instantapps.supervisor".
Android 8.0 (API level 26) has instant apps support built into the framework and there is no need to install these components.
The first time you navigate to a instant app, the system automatically asks you to opt-in as shown below.
Go to Google > Instant Apps to manually opt in or opt out Android Instant Apps from the Settings app . If you do not opt-in, the developer mode does not work on the device. If you run into issues setting up your development environment or provisioning your device for Android Instant Apps, see Troubleshoot Development Issues.
Now that you set up your development environment, you can create a simple instant app.