Building your AR App to iOS
If you want to build your games and never have your build expire, Apple has an Apple Developer Program; however, it is not free.
So, for simple testing, all we need is an Apple ID. If we are using a simple Apple ID to upload our app, the build will be available for two days, which is sufficient for quick testing. If you don’t already have an Apple ID, create one now.
Next, we want to make sure we are within the iOS build settings within Unity, and make sure Development Build is enabled.
Then, within Player Settings → Player, we want to enable “Requires ARKit Support.”
Next, we can build our project. Create a new folder outside of the project folder and build it here. This will build our project over into XCode, which we should have installed from the App Store already.
Once the build finishes, open the XCode file in the build.
Then, go ahead and select Window → Devices and Simulators.
Then, once your phone is connected to your Mac, you might see a message that says to enable developer mode in Settings → Privacy & Security on your iPhone. Then, scroll to the bottom and you should see developer mode. Enable it now.
Once enabled, your phone will restart and another pop-up will be displayed ensuring you want to enable developer mode. Select the Trust option.
Next, XCode will run its process. Chances are your build will fail, that is because we still need to sign our app. If you notice under Status, it says Unity-Phone requires a provisioning Profile.
All we need to sign our app is an Apple ID. Go ahead and select the XCode tab and select Settings.
Now, we can add our Apple ID.
Once your Apple ID is displayed on the list, we can move on. You will see that we still don’t have any provisioning profiles to choose from; however, if we select “Automatically Manage Signing” we will have the option to select a Team. Go ahead and select your name from the list.
Now, we should be able to press the Play button on the top left and test our app!
I did have another error stating it “Failed Registering Bundle Identifier.”
To fix this, I had to create a unique Bundle Identifier within Player Settings → Player. Originally, the name was much longer, so I just placed a simple “AppNameHere.”
You might also want to change the Company Name.
And you may have one extra step to do on your phone. I had a warning message pop up stating that there was an “Untrusted Developer.”
To fix this, go to your Settings → General → VPN & Device Management. Select the developer app with your email or ID on it and then select trust.
Now, everything should work and my project is playing on my phone!
You can even see live script changes in your XCode window when playing. This is helpful when trying to Debug certain things in your scripts. You can view this by clicking on the list button on the left menu and then selecting Console.
There you have it! A bit of a lengthy process at first, but once you get the hang of it, it’s much quicker. I hope this helps!