xcodebuild: profile doesn't include device ...

Have an iPhone project where we use XCode to develop and use xcodebuild to create our production releases. We have a complete build system and scripts that we have been using for years, across many versions of MacOS and XCode, and without problems.

Problem: I just moved to a new Mac Mini M1 and the xcodebuild process now generates an error and fails. There have been no other changes in the code or the project between building on my old Mac Mini and the new M1 Mini.

WAS USING:
  • MacOS 10.15.7, on Mac mini (Late 2012)

  • XCode version: 12.2

NOW USING
  • MacOS 11.0.1, on Mac mini (M1, 2020)

  • XCode version: 12.2

The "xcodebuild archive" produces the following error:

Code Block
error: Provisioning profile "XXXXXXX Development Profile" doesn't include the currently selected device "Chris’s Mac mini" (identifier XXXXXX-XXXXXXXXXX). (in target 'XXXXXXX' from project 'XXXXXX')

Now, "Chris’s Mac mini" is the name of my new development machine. I'm building a iPhone app, and our provisioning profile DOES contain a number of device IDs for various iPhones we test on.
  • Why would it care that my Mini is not in that list?

  • When I try, I can't even add a Mac ID to the provisioning profile

  • Our normal xcodebuild command line is rather complex, but even if I run it with:

Code Block
xcodebuild -scheme <MyTargetName>
  • and nothing else, I still get the error. noted above

Any suggestion appreciated.
Chris






Well, I'll answer my own question.

After some research on using xcodebuild, I found references to the "-destination" argument. I then added
Code Block
-destination 'generic/platform=iOS'

to my xcodebuild command line, and things seem'd to compile without errors.

I suppose that I should have been using this in the past, it's only when running on MacOS 11.X that is seems to enforce this.

Cheers!

18
I have been using the new M1 MBP to develop and test iOS apps on my Mac by building to the "My Mac (Designed for iPad)" option. I have done this many many times and everything worked fine and perfectly well until yesterday when I got the error "Provisioning profile "iOS Team Provisioning Profile" doesn't include the currently selected device "Ryan's MacBook Pro" (identifier XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)". I have made no changes to the project that would affect this that I know of, It builds just fine on the iPhone Simulators, but I would like to use the "My Mac (Designed for iPad)" option. I don't know if this might have affected it, but I happened to not be connected to the internet the first time I experienced issues and Xcode told me "Device "Ryan’s MacBook Pro" isn't registered in your developer account." and prompted me register my device it when it actually was registered on my developer account, it just didn't know since I was offline.

@ryandu

Dear Ryan, Me too facing same issue. Did you get any solution for this? How can fix this issue?

 -destination 'generic/platform=iOS`

When add this to my xcodebuild command line, it compiles without error.

I avoided the error by following the steps below.

  1. Access the certificate from the Apple Developer site.
  2. Download the certificate.
  3. Drag the downloaded file into Xcode.
xcodebuild: profile doesn't include device ...
 
 
Q