Version: 2021.3
Language : English
iOS build settings
App thinning

Build for iOS

This page contains instructions on how to build your Unity application for iOSApple’s mobile operating system. More info
See in Glossary
. For information on the build process for iOS and the tools Unity uses, see How Unity builds iOS applications.

At a high level, the iOS build process has two steps:

  1. Unity generates an Xcode project.
  2. Xcode builds the generated project into the application.

Unity can perform step one on all operating systems that run the Unity Editor. However, since you can only install Xcode on a macOS device, Unity can only perform step two on a macOS device. This means to fully build an iOS application locally, your development machine must run macOS. If it doesn’t, one alternative is to use Unity Cloud Build which can build your applications for you in the cloud. This makes it possible to develop iOS applications on a non-macOS machine. For information on how to set up Unity Cloud Build, see Unity Cloud BuildA continuous integration service for Unity projects that automates the process of creating builds on Unity’s servers. More info
See in Glossary
.

Build your application from the Editor

To build your Unity application for iOS:

  1. Select File > Build Settings.
  2. From the list of platforms in the Platform panel, select iOS.
    Note: If iOS is greyed out, set up your project for iOS development.
  3. Click either Build or Build and Run.
  4. Select the destination for Unity to place the Xcode project. If you selected Build and Run and use a macOS device, Xcode builds the generated project into the application and installs the application on the iOS device connected to your computer.
  5. Click Save. If an Xcode project already exists in the target directory, Unity displays an alert and gives you a choice on how to proceed. For information on the options available, see .

Tip: After you specify the output path the first time, you can use the Cmd+B keyboard shortcut to build and run the application. Unity uses the Append mode to regenerate the Xcode project.

Build a Unity Xcode project from the command line

After Unity generates the Xcode project, you can build and run the application from the command line. To do this:

  1. Open the terminal and navigate to the Xcode project directory.
  2. Find the device ID of the device you want to run the application on. You can find this in Xcode under Window > Devices and Simulators.
  3. Enter the following command into the terminal where <device-id>is your device ID.
    unity$ xcodebuild test -destination "platform=iOS,id=<device-id>" -scheme Unity-iPhone.

Additional resources

iOS build settings
App thinning