xref: /expo/docs/pages/build-reference/apk.mdx (revision dfd15ebd)
1---
2title: Building APKs for Android emulators and devices
3---
4
5The default file format used when building Android apps with EAS Build is an [Android App Bundle](https://developer.android.com/platform/technology/app-bundle) (AAB / **.aab**). This format is optimized for distributing to the Google Play Store, but AABs can't be installed directly to your device. To install a build directly to your Android device or emulator, you need to build an [Android Package](https://en.wikipedia.org/wiki/Android_application_package) (APK / **.apk**) instead.
6
7## Configuring a profile to build APKs
8
9### Managed projects
10
11To generate an **.apk**, modify the [**eas.json**](/build/eas-json.mdx) by adding one of the following properties in a build profile:
12
13- `developmentClient` to `true` (**default**)
14- `buildType` to `apk`
15- `gradleCommand` to `:app:assembleRelease`, `:app:assembleDebug` or any other gradle command that produces **.apk**
16
17```json eas.json
18{
19  "build": {
20    "preview": {
21      "android": {
22        "buildType": "apk"
23      }
24    },
25    "preview2": {
26      "android": {
27        "gradleCommand": ":app:assembleRelease"
28      }
29    },
30    "preview3": {
31      "developmentClient": true
32    },
33    "production": {}
34  }
35}
36```
37
38Now you can run your build with `eas build -p android --profile preview`. Remember that you can name the profile whatever you like. We named the profile `"preview"`, but you can call it `"local"`, `"simulator"`, or whatever makes the most sense for you.
39
40## Installing your build
41
42### Emulator ("Virtual device")
43
44> If you haven't installed or run an Android Emulator before, follow the [Android Studio emulator guide](/workflow/android-studio-emulator.mdx) before proceeding.
45
46- Once your build is completed, download the APK from the build details page or the link provided when `eas build` is done.
47- Open up your emulator.
48- Drag the APK file into the emulator.
49- The app will be installed in a few seconds. When it's complete, navigate to the app launcher, find the app icon and open it.
50- You can share this build, it will run on any Android Emulator or device.
51
52### Physical device
53
54#### Download directly to the device
55
56- Once your build is completed, copy the URL to the APK from the build details page or the link provided when `eas build` is done.
57- Send that URL to your device. Maybe by email? Up to you.
58- Open the URL on your device, install the APK and run it.
59
60#### Install with `adb`
61
62- [Install adb](https://developer.android.com/studio/command-line/adb) if you don't have it installed already.
63- Connect your device to your computer and [enable adb debugging on your device](https://developer.android.com/studio/command-line/adb#Enabling) if you haven't already.
64- Once your build is completed, download the APK from the build details page or the link provided when `eas build` is done.
65- Run `adb install path/to/the/file.apk`.
66- Run the app on your device.
67