Xcodebuild error: "Provisioning profile doesn't include the currently selected device"

When I try to archive my Unity game for iOS using the following command:

xcodebuild \
 -workspace "${IOS_PROJ}/Unity-iPhone.xcworkspace" \ 
-scheme Unity-iPhone \ 
-derivedDataPath build \ 
-configuration Release \ 
-archivePath "${ARCHIVE_PATH}" \ 
archive

I get the following error message:

error: Provisioning profile "PROFILE NAME" doesnt include the currently selected device "M2 Mac Mini" (identifier {MAC UUID}).

I've checked my provisioning profile and it includes my device UDID, but the error message is referencing a UUID instead. How can I fix this issue?

I tried adding my UUID on my profile but apple doesn't let me do that.

Any help would be greatly appreciated. Thanks!

It seems like xcodebuild is trying to build your project for your Mac rather than for iOS. You can control this using the -destination option. You can supply either a specific device or a generic device. See the Destinations section of the xcodebuild man page for the details.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Xcodebuild error: "Provisioning profile doesn't include the currently selected device"
 
 
Q