xcodebuild different provisioning profile for target dependency
I spent far too long working on this today. I was on my way to bed when the answer hit me:
In each of your targets's Build Settings you should set a $VARIABLE
for the profile name. To do this, selected "Other" from the bottom of the list of profiles. Doing this will open a text field - choose a different $VARIABLE
for each target - for example I chose $APP_PROFILE
for the container app target and $EXTENSION_PROFILE
for my Today extension target
This will result in something like the following:
Finally, when building with xcodebuild
, specify the profile UUIDs as you did with PROVISIONING_PROFILE
:
xcodebuild ... APP_PROFILE="85b6f019-d5e5-43a7-9e8f-e3aaed64a7e4" EXTENSION_PROFILE="e50cf605-ab63-40ad-8329-2758359ea748"
Building from within XCode seems to be unaffected - as far as I could tell XCode is selecting the default profiles (as if in "Automatic" mode)
Theoretically this would support multiple extensions too.
Works for me with XCode 6.3 :)
XcodeBuild requiring provisioning profile for Target? Error Domain=IDEProvisioningErrorDomain Code=9
I'm learning a lot every day but luckily a senior developer was able to help me figure out how to make xcodebuild work for me. I am using Xcode 10.0
It seems that in the
Build Settings
my bundle identifier inPackaging
needs to only contain the basic Bundle Identifier,com.mycompany.app
, no suffix for DEV/QA/TEST can be added or it will fail to build an .ipa fileThe provisioning profiles are numerous for my company. We have one for each environment but it turns out we have a catchall profile that our app would rather use
com.mycompany.*
I have some more learning to do there.I used fastlane, it was what I originally wanted to do and I think to use xcodebuild I would need to insert the provisioning profile UUID as an argument there. Here is my new
build_ios_app()
in my fastfile that will let me build. Fastlane and xcodebuild will overwrite whatever provisioningprofile data is in your xcode and exportoptions.plist as well as other things such asexport_method
. By putting thePROVISIONING_PROFILE_SPECIFIER
you can save yourself some trouble.build_app(
workspace: "myapp.xcworkspace",
scheme: "DEV",
export_method: "enterprise",
export_options: {
signingStyle: 'manual',
provisioningProfiles: {
"com.mycompany.myapp" => "*****UUID*****"
}
},
xcargs: "PROVISIONING_PROFILE_SPECIFIER=\"*****UUID*****\"")
Related Topics
Check If Property Is Set in Core Data
Prevent Segue in Prepareforsegue Method
Testing Corelocation on iPhone Simulator
How to Animate the Change of Image in an Uiimageview
How to Crop Uiimage on Oval Shape or Circle Shape
No Avplayer Delegate? How to Track When Song Finished Playing? Objective C iPhone Development
How to Know If Two Emojis Will Be Displayed as One Emoji
Nscamerausagedescription in iOS 10.0 Runtime Crash
Dynamic Height Issue for Uitableview Cells (Swift)
How to Change Uinavigationbar Background Color from the Appdelegate
What's the Best Way to Handle Multiple Skscenes
Where's the Difference Between Setobject:Forkey: and Setvalue:Forkey: in Nsmutabledictionary
How to Display .Svg Image Using Swift
Custom Installed Font Not Displayed Correctly in Uilabel
Using Iskindofclass with Swift
How to Create Layout Constraints Programmatically