Skip to content

iOS Executable Compilation

Andreas edited this page Feb 13, 2023 · 13 revisions

Building an executable for iOS devices (iPhone, iPad, etc.) requires further compilation of the output that is generated by Unity.

The following explains the required steps to create an app file for iOS (not to be confused with the app file of macOS or tvOS).

You need

  • Unity (required version can be found here)
  • XCode (13.4)
  • Apple Developer account (using your Apple ID)
  • iPhone (connected to your Mac)
  1. Open Unity Hub and add "Play" ("Play Companion") to your projects via "Open" -> "Add project from disk".
image
  1. Open "Play" ("Play Companion") by selecting it from the list of projects
image
  1. Once Unity has finished loading the project (this may take a while), goto "File" -> "Build Settings...", select "iOS" under "Platforms" and click on "Switch Platform"
image
  1. Once Unity has finished switching the platform (compiling C# Scripts takes quite a while), click on "Build and Run" and select/create a new build directory for the iOS build, e.g. "iOS".
image
  1. Once Unity is done creating the XCode project (this will again take quite a while), it will automatically be opened in XCode for a final compilation. The automatic compilation in XCode will most likely fail, because some settings have to be changed.

  2. In the upper left corner, select the project navigator (blue folder), below it select "Unity-iPhone", then select "Targets" -> "Unity iPhone" and then in the tab "Signing & Capabilities", enable "Automatically manage signing" (confirm), delete "In-App purchase" by clicking on the recycle bin and select your Developer profile as Team: image

  3. From the menu, select "Product" -> "Build" to trigger a new build. Again, this will take quite a while. If this builds without errors, hit the "Play" Button to transfer and start the app on your iPhone.

  4. In case the previous step fails: On your iPhone, goto "Settings" ("Einstellungen") -> "General" ("Allgemein") -> "VPN and device management?" (VPN und Geräteverwaltung), you should see your developer app. Click on it and trust yourself as a developer.

IMG_0001

Clone this wiki locally