Recently I moved to using an M1 Mac Mini as a build machine for Unity IOS projects through Xcode.
Often I would use the Unity option to ‘Build and Run’ which would auto open Xcode and build the app – often this would select the first available device target. I can always select the iPhone to build to but it always reverts back to ‘My Mac’ build target when Xcode opens the project again despite the phone staying connected via USB.
This M1 Mac Mini seems to have ‘My Mac (Designed for iPad)’ as a build target for iPhone/iPad only apps (not mac build target) and Xcode automatically chooses to build for that target rather than the connected iPhone when Unity exports the build.
Is there a way to exclude that My Mac build target in Xcode or in the Xcode project? I only want to test on device and we are exporting as Device SDK not Simulator SDK for this reason.
3
Answers
From this forum post on Unity Forum post I made is an easy editor script fix
Try to connect your device to Xcode via USB to see if it detects your device, once Xcode recognizes your device select it and build your project on that device of yours.
You can hide it by setting this option to No
After that, choose "Append" instead of "Replace" every time you "Build and Run" your Unity project. If you choose "Replace", Unity will erase Xcode settings and you will need to set it again.