Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable -allowProvisioningUpdates for gym builds in Xcode 9 by default #10345

Closed
wants to merge 1 commit into from

Conversation

KrauseFx
Copy link
Member

Fixes #9589

@sander-m
Copy link
Contributor

Does this work in CI environments? I suspect that an Xcode user needs to be logged in for the signing process to work, since it creates and updates profiles in the dev portal automatically.

@KrauseFx
Copy link
Member Author

Oh that's a great question. Actually, I don't know. Also, I don't know if this will fail the build in case the user isn't logged in. Maybe it requires some more testing, let me know if you hear/know anything :)

@sander-m
Copy link
Contributor

From xcodebuild --help

-allowProvisioningUpdates  
Allow xcodebuild to communicate with the Apple Developer website. 
For automatically signed targets, xcodebuild will create and update profiles, app IDs, and certificates. 
For manually signed targets, xcodebuild will download missing or updated provisioning profiles.
Requires a developer account to have been added in Xcode's Accounts preference pane.

Requires a developer account to have been added in Xcode's Accounts preference pane
I wonder if this can be automated for CI purposes.

@KrauseFx
Copy link
Member Author

Yeah, nice catch, thanks for posting this. Yeah, if there is a way to detect if the user is logged in Xcode, that would probably be enough. Are you interested in looking more into this and seeing if you can find a plist file or Keychain entry that's being added when you login, so we can query that?

@sander-m
Copy link
Contributor

After adding my Apple ID to Xcode 9 for the first time, those entries were added to my Keychain:

screen shot 2017-09-19 at 11 26 25 am

Would it be sufficient to check for existence of com.apple.gs.xcode.auth.com.apple.account.AppleIDAuthentication.token using the security system tool? This would probably require the keychain to be unlocked, but seems to work:

security find-generic-password -s com.apple.gs.xcode.auth.com.apple.account.AppleIDAuthentication.token

This not a perfect check though, because after removing my Apple ID from Xcode again, those keychain entries still exist.

@KrauseFx
Copy link
Member Author

Oh nice. Mh, so that's the password + email is stored, do you think we can find out the location of the plist files on where the account list is being stored?

@kdawgwilk
Copy link

But you can also sign in to Xcode multiple times so even an account exists that doesn't mean that it will have access to the correct dev team on Apple dev portal

@jonkan
Copy link

jonkan commented Oct 4, 2017

I'm a little worried that allowProvisioningUpdates would break our setup, i.e. losing control over what profile is used.

We have enterprise apps and use sigh to (re)generate a profile that gym picks up when exporting the ipa. And with Xcode 9 this now fails as others have reported in #9589, xcodebuild fails with a "No profiles for '<bundle-identifier>' were found".
Passing allowProvisioningUpdates does make it work, but doesn't result in the sigh-generated profile being used (even though it's specified in the export options plist generated by gym)!

However, as @threat70 mentioned in comment I also found that adding signingStyle manual to the export options plist file made xcodebuild use the correct profile and export successfully.

	<key>method</key>
	<string>enterprise</string>
	<key>provisioningProfiles</key>
	<dict>
		<key>bundle-identifier</key>
		<string>profile-name</string>
	</dict>
	<key>signingStyle</key>
	<string>manual</string>

According to xcodebuild -help, signingStyle defaults to automatic for apps that were automatically signed when archived (which is our case). I assume this is the reason xcodebuild seems to ignore the provisioningProfiles entry..

@Alexander-Ignition
Copy link

@jonkan, thank you very much
I had the same problem

@KrauseFx KrauseFx mentioned this pull request Oct 6, 2017
4 tasks
@revolter revolter mentioned this pull request Oct 9, 2017
Copy link

@felipelmota felipelmota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had the same issue for a week and this fix worked to me after update to Xcode 9. Worked like charm.

@TMUSJRad
Copy link

TMUSJRad commented Oct 16, 2017

Is there a timeframe for when this will get merged? We have a build using fastlane and Xcode 9 and it is broken until this fix is in. Thanks!

For some reason, adding the export_xcargs: "-allowProvisioningUpdates" to the gym call does not add the flag to the xcodebuild command.

@AnisovAleksey
Copy link
Contributor

@BCOVJRad I think need find reason why export_xcargs doesn't work, without specify -allowProvisioningUpdates always.

@robotive
Copy link

@KrauseFx I think this breaks Jenkins when using a non-Admin/Member Apple ID, which is what we use on our CI slaves. My understanding is that an Admin-role Apple ID is required for -allowProvisioningUpdates to properly work.

@ohayon
Copy link
Contributor

ohayon commented Dec 4, 2017

Hey folks! I am going to close this PR because it looks like #10272 has been fixed by other changes 😄 🚀

@ohayon ohayon closed this Dec 4, 2017
@fastlane fastlane locked and limited conversation to collaborators Feb 3, 2018
@revolter revolter deleted the allow-provisioning-updates branch May 20, 2018 14:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet