-
-
Notifications
You must be signed in to change notification settings - Fork 197
iOS provisioning profiles #2436
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
Comments
Handling CI for iOSSetting up CI you can run
Mind the build version should be updated in the And then execute |
|
On a clean machine without any provisioning profile downloaded running
|
This may be of interest: https://pewpewthespells.com/blog/migrating_code_signing.html |
Selecting provisioning profile is tightly coupled with the |
@hristoborisov I got the same error just now. What worked for me:
I figured that these steps will force macOS to do whatever is needed to setup for running simulators, and it worked! |
Hi, I am currently having some trouble with the Provisioning File(s) for my app when I try running it on a physical device. I am not sure if this is the right place place this issue But I was hoping someone could help me troubleshoot this process. Here is my console output after running the tns run ios --teamId [myTeamID] command: Code Signing Error: Automatic signing is unable to resolve an issue with the "noSnow" target's entitlements. Automatic signing can't add the com.apple.keystore.device and com.apple.keystore.access-keychain-keys entitlements to your provisioning profile. Switch to manual signing and resolve the issue by downloading a matching provisioning profile from the developer website. Alternatively, to continue using automatic signing, remove these entitlements from your entitlements file and their associated functionality from your code. Any help would be greatly appreciated, thanks |
tns run ios --emulator |
+1 ...Any news on the code signing problem solving ?! |
Closing this feature. All tasks described in it are implemented. For any problems regarding ios code signing please log separate issue, providing as much details as you can. |
(a.k.a iOS provisioning hell)
Naïve overview on iOS provisioning and certificates
Provisioning profiles can be 3 types and each of them binds together some properties to identify its type, the devices it can deploy to, the code signing certificate that can be used with it:
In addition as of Xcode 8 there two signing styles: "Manual" and "Automatic". When enabled "Automatic" signing style within the Xcode the IDE will be allowed to recreate provisioning profiles and code signing certificates, during build a team id is provided, either through the flags in the pbxproj or xcconfig and the xcodebuild command line tool would select a provisioning profile and signing certificate for that team. When set to "Manual" a provisioning profile is provided either through the pbxproj or xcconfig and the xcodebuild will use this exactly provisioning profile. When a certificate is automatically generated by Xcode it can not be used with "Manual" signing.
N.B> The team id and provisioning profiles can also be specified through the command line of xcodebuild but when building multi-target projects (such is the case with Cocoapods) the provided signing is also applied to the pods frameworks, often resulting in mismatch. (given provisioning profile with org.nativescript.* app id it will fail to sign the org.cocoapods.* frameworks).
App identifier can be categorized in:
Certificates can be two types:
Certificates contain a public and a private key, the public key is uploaded to apple member center, while the private key stays on the admin or developer's machine. Loosing the private key requires the certificate to be revoked and a new one to be created. Recreating a certificate results in cascading need to renew the provisioning profiles it was used in.
Within {N}
Currently we have to support three main separate scenarios:
Development
During development a provisioning profile should be provided in order the app to be sign so it can be deployed on a device.
AppStore
Building for the store requires the app to be built for release and distribution provisioning profile in pair with distribution certificate to be used when signing the app.
CI
CI usually is performed either for test and automation or automated App Store submission.
Existing Microinteractions in the NativeScript CLI
Specifying provisioning profile with Manual signing style using --provision
With the #2393 specifying provisioning profile and "Manual" signing style has been enabled. The workflow is as follow:
tns prepare|build|run ios --provision
will list a table with eligible provisioning profiles. The App ID, devices, etc. will filter provisioning profiles that will not support the current app.tns prepare|build|run ios --provision <uuid-or-name>
will save the specified provisioning profile in the platforms/ios/.pbxproj` along "Manual" signing style. Once set all subsequent commands will use the provided provision.Along this, should "Manual" signing and a provision be specified using Xcode in the .pbxproj the CLI should respect it and use it if no --provision is specified on the command line
This behavior should also allow for CI to set a provision during build
Specifying development team with Automatic signing style using --team-id
When
tns build|run ios --team-id <team-id>
is called, the team-id will be provided to the xcodebuild and Automatic signing style will be used to sign the app.N.B.> In contrast with --provision this will not update the pbxproj as this option precede the --provision and during its implementation we had no convenient method to update the pbxproj.
N.B.> This have been reported to fail due to xcodebuild picking a wrong provisioning profile when multiple profiles are available.
Specifying team-id for Automatic signing style when no other means to sign the app si provided
When
tns build|run ios
is called and targets a device, and no signing is specified in any other way, an interactive dialog will prompt for a team-id. It can be persisted in the app/iOS/build.xcconfig. The team-id will be provided to the xcodebuild and Automatic signing style will be used to sign the app.N.B.> This have been reported to fail due to xcodebuild picking a wrong provisioning profile when multiple profiles are available.
Specifying singing in the xcconfig
Currently the
app/App_Resources/iOS/build.xcconfig
is used for the app target and as such can hold flags used for singing. The workflow would be as follow:tns prepare ios --provision
to list provisioning profiles and team along with their ids.app/App_Resources/build.xcconfig
set either:or
Note that step 2 can either be done manually or it can be automated with CI scripts to allow for {N} apps to be build on CI.
Building and uploading to the App Store
tns publish ios
will build the app for release, produce Xcode archive, then export ipa signed for App Store distribution and use the Application Loader program to upload it to the App Store. Several options can be provided either through the command line or should command line args be omitted - through interactive dialog: iTunes Connect username and password, distribution provisioning profile;As some of these interactions differ in behavior, we should consolidate the whole provisioning experience.
The text was updated successfully, but these errors were encountered: