How setup different certificates and provisioning

2019-09-02 17:07发布

This might be a stupid question but very important one for developers to build applications.

I just want to ask is Can we set up Code Signing Identity and Provisioning Profile conditionally for Development and Production environment for a xcode project?

So when we build application for production environment we can easily change the condition and build application for production immediately. Otherwise we need to do many stuffs like change Code Signing Identity and Provisioning Profile and package name too.

So is it possible to apply this kind of condition, if yes then how?

I am very curious to know how this happens.

Thanks in advance.

1条回答
Lonely孤独者°
2楼-- · 2019-09-02 17:38

If I understand you correctly, you can also do it from the Xcode GUI:

  1. Create development and production provision profile using the Apple Developer Site.

  2. In your target setting, go to Build Settings and write in the search field Code Sign.

enter image description here

  1. Open the small arrow on the left of the provisioning profile. You can see that you can configure for debug your development profile and for the release, your production (or AdHoc) profile.

  2. Go to you scheme menu on the top left corner and choose Manage Scheme.

enter image description here

  1. You probably have only one scheme configured, so select it (by pressing on it once) and press on the settings button on the bottom left corner. Choose Duplicate.

enter image description here

  1. Give this scheme a name (I suggest something like MyProjectRelease) and choose Release configuration.

  2. Now all you have to do before building your project, is change to the wanted scheme.

查看更多
登录 后发表回答