You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xcode 9中xcconfig配置PROVISIONING_PROFILE_SPECIFIER失效问题咨询

Xcode 9: PROVISIONING_PROFILE_SPECIFIER in xcconfig vs exportOptionsPlist

Great question—this is a common gotcha when moving to Xcode 9 and later, so let’s break this down clearly:

1. It’s not that xcconfig is useless, but behavior differs between build/archive and export stages

  • Build/Archive phase: Your existing xcconfig setup with PROVISIONING_PROFILE_SPECIFIER still works perfectly. Xcode will respect the value set in your Scheme-linked xcconfig file when compiling and creating the archive. This means you can keep using xcconfig to isolate signing configurations per Scheme (e.g., dev vs staging vs production) as you did before.
  • Export Archive phase: This is where the change happens. Starting in Xcode 9, when you run xcodebuild -exportArchive, the tool prioritizes the provisioningProfiles key in your exportOptionsPlist over any signing settings from the xcconfig. This is because the export phase focuses on preparing the build for distribution (Ad Hoc, App Store, Enterprise, etc.), which often requires a different provisioning profile than the one used for archiving.

2. How to use both tools effectively

You don’t have to abandon xcconfig—instead, combine it with exportOptionsPlist for a clean workflow:

  • Keep using xcconfig for build-time signing: Maintain your Scheme-specific xcconfig files to set PROVISIONING_PROFILE_SPECIFIER, CODE_SIGN_IDENTITY, and other build-related signing flags. This keeps your environment configurations organized and separated.
  • Use exportOptionsPlist for distribution signing: Create separate plist files for each distribution type (e.g., ExportOptions-AppStore.plist, ExportOptions-AdHoc.plist). In each, define the provisioningProfiles dictionary to map your bundle ID to the correct distribution provisioning profile:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>method</key>
        <string>app-store</string>
        <key>provisioningProfiles</key>
        <dict>
            <key>com.yourcompany.yourapp</key>
            <string>Your App Store Provisioning Profile Name</string>
        </dict>
    </dict>
    </plist>
    
    Alternatively, if you use Apple’s automatic signing, set signingStyle to automatic in the export plist—Xcode will handle matching the correct provisioning profile for you without needing to specify provisioningProfiles.

3. Why you might think xcconfig "stopped working"

The confusion usually comes when you export an archive and see signing issues. The archive itself was signed correctly using your xcconfig settings, but the export process overrides those settings to apply the distribution-specific profile. So it’s not that the xcconfig is broken—it’s just that the export phase has its own priority for signing configuration.


内容的提问来源于stack exchange,提问作者sanjayp

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 08:36:26