Search code examples
iosxcodeunity-game-engineprovisioning-profileapple-silicon

iOS project reports error of provisioning profile not including the current mac os computer


I'm trying to move jenkins building jobs of our Unity3D project to a new mac machine with apple M2 chipset. Things go well before the xcode part. I copy the certificates (p12) and the corresponding provisioning profiles and install them on the new machine, and I run the following command (as we did before) for the xcode archiving stage.

xcodebuild archive -workspace Unity-iPhone.xcworkspace -scheme Unity-iPhone -configuration Release -archivePath XXXXXX CODE_SIGN_STYPE=MANUAL CODE_SIGN_IDENTITY="iPhone Developer" PROVISIONING_PROFILE_APP=xxxxxx PRODUCT_BUNDLE_IDENTIFIER_APP=XXXXXX

Errors show for both the provisioning profile saying that

Provisioning profile xxxxxx doesn't include the currently selected device "MyMacMachineName" (identifier xxxxxx). (in target 'Unity-iPhone' from project 'Unity-iPhone')

Weird thing here is that the selected device is my mac rather than any iOS device (I'm not connecting any).

This problem ONLY occurs in COMMAND LINE. Xcode 15.4, Mac OS 14.3

Any clue?


Solution

  • When we use old mac machines, things got right. But with the Apple chipset machine, we need to explicitly add the following to the xcodebuild CLI tool:

    -destination 'generic/platform=iOS' -destination 'generic/platform=iPadOS'