Search code examples
iosiphonexcodexcodebuild

xcodebuild: Check dependencies Provisioning profile "iOS Team Provisioning Profile doesn't include the currently selected device "iPhone"


I'm trying to automate our build process using xcodebuild and trying to archive the build before create the IPA but I'm getting the following error:

Check dependencies
Provisioning profile "iOS Team Provisioning Profile: com.meme.myApp" doesn't include the currently selected device "iPhone".
Code signing is required for product type 'Application' in SDK 'iOS 10.3'
Code signing is required for product type 'Application' in SDK 'iOS 10.3'
Code signing is required for product type 'Application' in SDK 'iOS 10.3'
Code signing is required for product type 'Application' in SDK 'iOS 10.3'
Code signing is required for product type 'Application' in SDK 'iOS 10.3'
Code signing is required for product type 'Application' in SDK 'iOS 10.3'
Code signing is required for product type 'Application' in SDK 'iOS 10.3'
Code signing is required for product type 'Application' in SDK 'iOS 10.3'

This is how I'm trying to create the archive:

xcodebuild -workspace myApp.xcworkspace \
-scheme MyAccount \
 -configuration Debug \
 clean archive \
 -archivePath $PWD/build/myApp.xcarchive \
 DEVELOPMENT_TEAM=X12345ABCD

any of you knows what I'm doing wrong ? or why of the error?

I'll really appreciate your help.


Solution

  • You should add a generic build destination to your xcodebuild command with -destination 'generic/platform=iOS' to make this error go away. Or simply disconnect your iPhone from your machine :)

    If your goal is to generate an IPA, it's also highly advisable to build with Release config instead of Debug:

    xcodebuild -workspace myApp.xcworkspace \
    -scheme MyAccount \
     -configuration Release \
     -destination 'generic/platform=iOS'
     clean archive \
     -archivePath $PWD/build/myApp.xcarchive \
     DEVELOPMENT_TEAM=X12345ABCD