1---
2title: Building Standalone Apps on Your CI
3---
4
5> This doc was archived in August 2022 and will not receive any further updates. SDK 46 is the last SDK supported by Classic Builds and the Classic Build service will stop running for all SDK versions after January 4, 2023. Check out [Running builds on your own infrastructure](/build-reference/local-builds.mdx) and [Triggering builds from CI](/build/building-on-ci.mdx).
6
7> **Note:** macOS is required to build standalone iOS apps.
8
9This guide describes an advanced feature of Expo. In most cases you can build
10standalone Expo apps using Expo's build services as described in the guide
11on [Building Standalone Apps](building-standalone-apps.mdx).
12
13If you prefer to not rely on our builders stability and you don't like waiting
14in the queue to get your standalone app build then you can build your Expo
15project on your own. The only thing you need is Turtle CLI. Turtle CLI is
16a command line interface for building Expo standalone apps. You can use it
17both on your CI and your private computer.
18
19## Install Turtle CLI
20
21### Prerequisites
22
23You'll need to have these things installed:
24
25- bash
26- Node.js (version 10 or newer) - [download the latest version of Node.js](https://nodejs.org/en/).
27
28#### For Android builds
29
30- macOS or Linux
31- [Java Development Kit (version 8)](https://jdk.java.net/)
32
33#### For iOS builds
34
35- macOS
36- Xcode (version 11.4 or newer) - make sure you have run it at least once
37  and you have agreed to the license agreements. Alternatively you can run `sudo xcodebuild -license`.
38- fastlane - [see how to install it](https://docs.fastlane.tools/getting-started/ios/setup/#installing-fastlane)
39
40### Turtle CLI
41
42Install Turtle CLI by running:
43
44```sh
45$ npm install -g turtle-cli
46```
47
48Then run `turtle setup:ios` and/or `turtle setup:android` to verify everything
49is installed correctly. This step is optional and is also performed during
50the first run of `turtle build:[ios|android]`. Please note that the Android setup command
51downloads, installs, and configures the appropriate versions of the Android SDK
52and NDK.
53
54If you would like to make the first build even faster, you can supply the Expo
55SDK version to the setup command like so: `turtle setup:ios --sdk-version 38.0.0`.
56This tells Turtle CLI to download additional Expo-related dependencies for
57the given SDK version.
58
59All Expo-related dependencies will be installed in a directory named `.turtle`
60within your home directory. This directory may be removed safely if you ever
61need to free up some disk space.
62
63## Publish your project!
64
65When you're building standalone apps with Turtle CLI, the build process is happening on your local machine.
66Turtle CLI makes use of exactly the same codebase which is running on our servers (`expo build:[ios|android]` command).
67This means you're required to publish your app to Expo's servers or host it on your own server **before building it with Turtle CLI**.
68Whether you want Expo to host your app, or you'd like to do it yourself, all you need to do is follow the appropriate guide:
69
70- [Publishing an app to Expo's servers](/archive/classic-updates/publishing.mdx)
71- [Hosting an app on your own server](/distribution/custom-updates-server.mdx)
72
73## Start the build
74
75If you choose to publish your app to Expo servers, you must have an Expo
76developer account and supply your credentials to the `turtle-cli`.
77The recommended approach is to define two environment variables called
78`EXPO_USERNAME` and `EXPO_PASSWORD` with your credentials, though you may also
79pass these values to the build command from the command line. We recommend
80using the environment variables to help keep your credentials out of your
81terminal history or CI logs.
82
83Turtle CLI is using the published app manifest (and not the local app.json/app.config.js file)
84as a source of truth for your app configuration (`ios.buildNumber`, `android.versionCode`, and so on).
85
86### Building for Android
87
88Before starting the build, prepare the following things:
89
90- Keystore
91- Keystore alias
92- Keystore password and key password
93
94To learn how to generate those, see the guide on [Building Standalone Apps](building-standalone-apps.mdx)
95first.
96
97Set the `EXPO_ANDROID_KEYSTORE_PASSWORD` and `EXPO_ANDROID_KEY_PASSWORD`
98environment variables with the values of the keystore password and key password,
99respectively.
100
101Then, start the standalone app build:
102
103```sh
104$ turtle build:android \\
105  --keystore-path /path/to/your/keystore.jks \\
106  --keystore-alias PUT_KEYSTORE_ALIAS_HERE
107```
108
109If the build finishes successfully you will find the path to the build artifact
110in the last line of the logs.
111
112If you want to print the list of all available command arguments,
113please run `turtle build:android --help`.
114
115### Building for iOS
116
117Prepare the following unless you're building only for the iOS Simulator:
118
119- Apple Team ID - (a 10-character string like "Q2DBWS92CA")
120- Distribution Certificate .p12 file _(+ password)_
121- Provisioning Profile
122
123To learn how to generate those, see the guide
124on [Building Standalone Apps](building-standalone-apps.mdx) first.
125
126Set the `EXPO_IOS_DIST_P12_PASSWORD` environment variable with the value of
127the Distribution Certificate password.
128
129Then, start the standalone app build:
130
131```sh
132$ turtle build:ios \\
133  --team-id YOUR_TEAM_ID \\
134  --dist-p12-path /path/to/your/dist/cert.p12 \\
135  --provisioning-profile-path /path/to/your/provisioning/profile.mobileprovision
136```
137
138If the build finishes successfully you will find the path to the build artifact
139in the last line of the logs.
140
141If you want to print the list of all available command arguments,
142please run `turtle build:ios --help`.
143
144## CI configuration file examples
145
146See the [expo/turtle-cli-example](https://github.com/expo/turtle-cli-example) repository
147for examples of how to use Turtle CLI with popular CI services ([CircleCI](https://github.com/expo/turtle-cli-example#circleci)
148and [Travis CI](https://github.com/expo/turtle-cli-example#travis-ci)).
149