为 iOS 设备创建并运行云构建
了解如何使用 EAS Build 配置 iOS 设备的开发版本。
在本章中,我们将使用 EAS Build 创建一个可以在 iOS 设备上运行的开发版本。
¥In this chapter, we'll create a development build that can run on an iOS device with EAS Build.
iOS 设备的开发版本以 .ipa 格式生成,这是 iOS 应用安装的标准。
¥Development builds for iOS devices are generated in the .ipa format, which is standard for iOS app installations.

先决条件
¥Prerequisites
在我们开始之前,请确保你拥有:
¥Before we begin, ensure you have:
-
苹果开发者账户:这是访问 必要的凭证 来签署我们的应用所必需的,因为每个构建都需要进行签名以验证应用是否来自可信来源。EAS Build 有助于管理这些凭证。
¥Apple Developer Account: This is required to access necessary credentials for signing our app, as each build needs to be signed to verify that the app comes from a trusted source. EAS Build helps manage these credentials.
-
在 iOS 16 及更高版本上激活开发者模式:在你的设备上安装开发版本需要启用开发者模式。如果这是你第一次或者当前已禁用,请参阅 激活开发者模式 的这些说明。
¥Developer Mode activated on iOS 16 and higher: Installing development builds on your device requires Developer Mode to be enabled. If this is your first time or if it's currently disabled, see these instructions to activate Developer Mode.
配置文件
¥Provisioning profile
要在 iOS 设备上启动开发,我们必须:
¥To initiate development on an iOS device, we have to:
-
通过创建新的 配置文件 来注册设备。
¥Register the device by creating a new provisioning profile.
-
下载此配置文件并将其安装到设备上。
¥Download and install this profile onto the device.
1
Register an iOS device
With EAS CLI, run the command to register a new Apple device:
!!!IG0!!!
This command prompts us with the following questions
- You're inside the project directory. Would you like to use the your-account-name account? Press Y.
- Apple ID. For this step, enter your Apple ID. It will then log in to our Apple Developer account. Follow the steps in the terminal window.
- How would you like to register your devices? Select Website that generates a registration URL that can be opened on the iOS device.
Tip: If you or your team have multiple devices, you can share the provisioning profile link with those devices for downloading and installing the profile.
2
Download and install profile
On a device's web browser, open the link provided in the previous step and tap the Download Profile button.
Open the Settings app, which prompts us to register our device.
Tap Install to register the iOS device.
After the provisioning profile is installed, our device redirects us back to the web browser, displaying a success message indicating the completion of the process.
Development build for iOS device
1
Create
To create a development build on an iOS device, make sure that under the build.development
profile:
- The
developmentClient
is set totrue
in eas.json, which is done by the default configuration. - Then, run the
eas build
command withios
as the platform anddevelopment
as the build profile:
!!!IG1!!!
Tip: Next time you runeas build
command, you can also use-p
to specify the platform. It is short for--platform
.
This command prompts us with the following questions when we create the build for the first time:
- What would you like your iOS bundle identifier to be? Press return to select the default value provided for this prompt. This will add
ios.bundleIdentifier
in app.json if it isn't already defined. - Log in to our Apple Developer account. Since we are creating a development build for the first time, it will ask us to Generate a new Apple Distribution Certificate. Press Y.
- Select a device for ad hoc build. This is the key part, which is why we had to register a provisioning profile before. We can select one or all of our registered devices here and then press return to install that build on those devices later.
After responding, the build will queue up, and we can track its progress via a provided link by the EAS CLI in the Expo dashboard:
What does a build details page contain?
The build details page displays the build type, profile, Expo SDK version, app version, build number, last commit hash, and the identity of the developer or account owner who initiated the build.
In the above image, the current status of the Build artifact shows that the build is in progress. Upon completion, this section will offer an option to download the build. The Logs outlines every step taken during the iOS build process on EAS Build. For the sake of brevity, we won't explore each step in detail here. To learn more, see iOS build process.
What is iOS bundle identifier?
The ios.bundleIdentifier
is a unique name of our app. If we publish our app right now, the Apple App Store will use this property and its value to identify our app on the store.
This notation is defined as host.owner.app-name
. For example, our example app has com.owner.stickersmash
where com.owner
is the domain and stickersmash
is our app name.
2
Install
Once the build finishes, the Build artifact section gets updated, indicating that the build is complete:
This section provides the methods available for running the development build on an iOS device: Expo Orbit and Install button.
Expo Orbit allows for seamless installation of the development build on an iOS device. To use this method:
- Connect our iOS device to our developer machine using USB.
- Open the Orbit menu bar app.
- Select the Device in the Orbit app.
- On the Expo dashboard, under Build artifact, click the Open with Orbit.
After the build is installed, the Orbit app launches the development build on the device.
3
Run
Start the development server by running the npx expo start
command from the project directory:
!!!IG2!!!
- On the device, tap the app icon to open the development build.
- Use the account syncing feature by ensuring we're logged into both the EAS CLI and development build. As we're already logged into the EAS CLI, the next step is to log in through the UI of your development build.
- Tap Fetch development servers and select the server running from the list under Development servers.
Summary
Chapter 4: Create and run a cloud build for iOS device
We successfully used EAS Build to create and run development builds on iOS devices.
In the next chapter, learn how to configure our app config to install multiple app variants on a single device.