可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
So I'm trying to create an ad-hoc build using existing provisioning profile (that worked before) with Xcode 6.0.1 on Mavericks, but after trying to export this archive, I keep getting the following error:
Do I need to re-create my certificates and provisioning profiles, or is there a better solution? Thanks!
回答1:
I'm also facing this issue as a 'Team Member' role. The 'You are not allowed to perform this operation' warning leads me to believe that XCode is more strictly enforcing the roles defined here: https://developer.apple.com/programs/roles/
Even though I have access to the signing assets (certificate and provisioning profile), XCode won't allow me to specify them. Try upgrading your role to Team Admin.
Updated 2014-09-29:
After extensive research, I've found it is possible to generate the .ipa using xcodebuild from the command line even as a 'Team Member' role using the following:
xcodebuild -exportArchive -archivePath $projectname.xcarchive -exportPath $projectname -exportFormat ipa -exportProvisioningProfile "Provisioning Profile Name"
credit to 1
Note: As pointed out in the linked article, the "Provisioning Profile Name" is the name specified in the name field of the certificate (viewable from developer.apple.com).
You can automate the process in xcode by including the call into your project build script.
回答2:
Try to open your console and go to your Xcode project folder then type these commands:
to clean your project
xcodebuild clean -project YourProjectName.xcodeproj -configuration Release -alltargets
to build and archive your app
xcodebuild archive -project YourProjectName.xcodeproj -scheme YourSchemaName -archivePath YourProjectName.xcarchive
You can simply find YourSchemaName in
Xcode > Product > Scheme > Edit Scheme...
finally to create your app .ipa file
xcodebuild -exportArchive -archivePath YourProjectName.xcarchive -exportPath YourProjectName -exportFormat ipa -exportProvisioningProfile 'Your Provisioning Profile Name'
To find Your Provisioning Profile Name please login to Apple Developer Member Center and go to Certificates, Identifiers & Profiles, then click on Provisioning Profiles for iOS Apps. There you will find Your Provisioning Profile Name.
If it does not work try to replace single quote with double one ( ' with " ).
You will find .ipa file in your Xcode project folder.
After this you will able to open your .ipa file in iTunes and install on your iOS device.
I hope it helps!
回答3:
What's happening: Xcode need to sign build with valid Certificate. It is trying to locate one with no luck. Why? Because before Xcode6, you were allowed to sign AdHoc builds with your's developer certificate. And you were able to, because you have a private key for it. But now you need to sign Ad Hoc builds with Production Certificate. And you don't have a private key for it.
So steps required to make it possible to build from Xcode6 (https://stackoverflow.com/a/26061067/1918302):
Get a private key for your Production Certificate. (You need to export it from Mac keychain it has and import to your's keychain OR Revoke current and Create New production certificate. During creation you'll get one. Quoting here from link above:
BEWARE: revoking an enterprise distribution certificate invalidates all apps that were signed and deployed with that
certificate (official info)).
Create special XC Ad Hoc: Distribution provisioning profile (if you have Admin role in your team on developer.apple.com - Xcode will do this for you).
Set provisioning profile in your project's target -> Build Settings -> Code Signing to this created in step 2.
Done!
OR if those above not achievable, you can make a build using command line tools: https://stackoverflow.com/a/25979784/1918302.
But this seems to me as security hole and I don't believe that this will work for long time.
回答4:
We were able to work around this problem by simply having one of the admins download the "XC Ad Hoc: Distribution" profile from the dev center, then sending it to the "Team Member" who wanted to build, and letting him manually import it. Since he already had the cert, this was all he needed to be able to do the build and stop getting this error. Existing answers here are correct, but this is a low-friction way to get the last piece of the puzzle for many of us.
In summary, you need this profile and the cert with a private key in your keychain.
回答5:
For me, it turned out the cause of this was I had not set the project's provisioning profile property as per this answer.
回答6:
I my case, the problem was App ID. Of course the app did exist in my member center account. The problem was in Capabilities pane. Some of the capabilities had not resolved issue, but the build was succesed. This lead to the situation, when my App ID in member center and Xcode have different capabilities settings.
Removing this dissonance have resolved my problem.
Check it twice, if you have simular issue.
回答7:
You must define your account in Xcode->preferences->account
It seems that you have define an appleId which is not allowed to access IOS developer account.
Try to sign with that user in https://developer.apple.com/devcenter/ios/index.action and see if that user is allowed in an IOS developer program.
This can happens if you have signed with an iTunes connect. They are different accounts.
I hope this helps!
回答8:
Your distributed account is not match team .
You must define your account in xcodeproj->Identity->Team ->Add an Account
回答9:
I was also receiving this error because the Developer Certificate for the machine I was building on had expired.
Even after renewing that certificate, I was unable to Export the Build for App Store release.
Even after following the instructions in the accepted answer and upgrading that Developer account to an admin.
It turns out, that because the Archive was created while that Developer Certificate was expired, that Developer was unable to codesign using the Distribution Profile.
I had to recreate the Archive, after renewing the Developer Certificate, for that machine to be allowed to use the Distribution Certificate (already installed and previously working) to be allowed to codesign the new archive and upload to app store.
Sharing in case anyone else hits this edge case.