The short answer
A Unity iOS build has two stages: the Editor first generates an Xcode project, then Xcode compiles it into an app. The Unity Manual states that Xcode exists only for macOS, so a local build has to be done on a Mac; the official alternative without a Mac is the cloud-based Unity Build Automation. Scenes, scripts and assets are made on Windows as usual.
Which steps require macOS
Steps that need macOS
- Stage two, the Xcode compile. According to the build process page of the Unity Manual, Unity converts C# scripts into C++ source placed in the Xcode project, and it is IL2CPP, invoked by Xcode, that actually compiles them to machine code. That is also why Unity projects take a long time to compile in Xcode.
- Archiving, signing and exporting the .ipa.
What can be done on Windows
- All game content development, plus the iOS configuration in Player Settings (Bundle Identifier, version, icons and so on). These settings are saved in the project and travel to the Mac with the repository.
One point we could not verify
Whether the Windows Editor with the iOS Build Support module can export an Xcode project to be compiled later on a Mac is not stated clearly in the current Unity Manual. The Manual's wording is that if the development machine is not macOS, you cannot build locally. To avoid version and path differences between two machines, we suggest doing both stages on the remote Mac.
The official alternative without a Mac
Unity Build Automation completes the build in the cloud and gives you an .ipa, but you have to supply the signing files yourself; see our Unity code signing page.
How to do it on a remote Mac
Install Unity Hub, the same Editor version and the iOS module on the remote Mac
Use Unity Hub to install exactly the same Editor version as your project and tick the iOS Build Support module; for an Editor already installed, the module can be added afterwards in the Hub. Sign in to your Unity account in the Hub to activate the license. Then install Xcode from the App Store. The Manual recommends a minimum Xcode version; go by the requirements and compatibility page.
Get the project onto the remote Mac
Unity projects are usually large. Pull the project with Git plus large file storage, or with the version control tool your team already uses; do not drag files across. Leave out the
Librarydirectory. It is regenerated on this machine, and importing assets the first time you open the project takes a while.Switch to an iOS build profile
Following the Manual: File → Build Profiles → Add Build Profile, choose iOS in the platform list, and after adding it click Switch Profile to make it active. In older Editor versions the equivalent is the Build Settings window. Before building, confirm under Edit → Project Settings → Player that the Bundle Identifier is set.
Generate the Xcode project
Click Build in the build profile window and choose an empty directory as the output location. When you build to the same directory again, Unity asks whether to Replace or Append: Replace empties the directory and regenerates; Append keeps your changes to the project but only supports projects generated by the same Unity iOS version. Settings you added by hand in Xcode are lost with Replace.
Compile and archive in Xcode
Open the
.xcodeprojin the output directory. According to the Manual's Xcode project structure page, it contains targets such as Unity-iPhone (the launcher shell), UnityFramework (runtime and plugins) and GameAssembly (the code converted from C#). Select Unity-iPhone, set the run destination to the generic iOS device, and run Product → Archive. TheDataandLibrariesdirectories are refreshed on every build, so do not hand-edit anything in them.To skip clicking through Xcode by hand, use Build and Run
On macOS, Build and Run in the build profile makes Xcode carry on compiling after the project is generated. Its second half, however, installs the app on a connected iOS device, and the remote Mac has no device attached, so packaging still goes through Archive in the previous step.
FAQ
The Xcode compile takes a very long time. Is that normal?
Yes. IL2CPP has to compile a large amount of converted C++ code into libraries. The first full compile is the slowest; later ones are incremental. The actual time depends on project size and machine configuration, and we have no measured figures. For choosing a configuration, see the plans page.
Could I run out of disk space?
Possibly. The Unity Editor, the project's Library, the generated Xcode project and Xcode's intermediate files all take a lot of space. Estimate from your project size before ordering and, if needed, confirm the disk configuration with support.
Unity Build Automation or a remote Mac: which should I choose?
When the process is stable and you are only repeating builds, the cloud build is less effort. When you need to open Xcode to read compile errors, adjust project settings or run the simulator, you need a Mac whose desktop you can log in to.
A third-party SDK requires CocoaPods. What do I do?
That is a requirement of the plugin concerned and outside the scope of the Unity Manual. Your account on the remote Mac is an admin account, so you can install CocoaPods; follow that SDK's documentation for the steps.
Related
- How do I set up iOS certificates and signing for Unity without a Mac?
- How do I upload a Unity game to TestFlight and the App Store without a Mac?
- How do I debug Unity on the iOS simulator and a real iPhone without a Mac?
- Remote Mac vs GitHub Actions macOS runner or Codemagic: which should I use?
- iOS without a Mac: a remote Mac mini can build, sign and upload, but not debug on a real device
Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support