菜鸟教程小白 发表于 2022-12-12 15:58:56

ios - xcodebuild 存档未通过 ITMS 验证


                                            <p><p>我们的应用有一个 watchkit 应用 + 扩展。来自 XCode IDE 的文件总是通过 iTunes 商店验证。但是,通过 xcodebuild 命令工具(<strong>Xcode 6.4;构建版本 6E35b</strong>)生成的存档无法通过此验证,并出现以下错误:</p>

<pre><code>ERROR ITMS-90163: &#34;Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: &#39;aps-environment&#39; in &#39;Payload/TheDodo.app/PlugIns/DodoExtension.appex/DodoExtension&#39;.&#34;

ERROR ITMS-90164: &#34;Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. According to the provisioning profile, the bundle contains a key value that is not allowed: &#39;##########.###.##########.######&#39; for the key &#39;application-identifier&#39; in &#39;Payload/TheDodo.app/PlugIns/TheDodoWatchKitExtension.appex/TheDodoWatchKitExtension&#39;&#34;

ERROR ITMS-90163: &#34;Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: &#39;aps-environment&#39; in &#39;Payload/TheDodo.app/PlugIns/TheDodoWatchKitExtension.appex/TheDodoWatchKitExtension&#39;.&#34;

ERROR ITMS-90046: &#34;Invalid Code Signing Entitlements. Your application bundle&#39;s signature contains code signing entitlements that are not supported on iOS. Specifically, value &#39;##########.###.##########.######&#39; for key &#39;application-identifier&#39; in &#39;Payload/TheDodo.app/PlugIns/TheDodoWatchKitExtension.appex/TheDodoWatchKitExtension&#39; is not supported. This value should be a string starting with your TEAMID, followed by a dot &#39;.&#39;, followed by the bundle identifier.&#34;

ERROR ITMS-90163: &#34;Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: &#39;aps-environment&#39; in &#39;Payload/TheDodo.app/PlugIns/TheDodoWatchKitExtension.appex/TheDodoWatchKitApp.app/TheDodoWatchKitApp&#39;.&#34;

ERROR ITMS-90163: &#34;Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: &#39;com.apple.security.application-groups&#39; in &#39;Payload/TheDodo.app/PlugIns/TheDodoWatchKitExtension.appex/TheDodoWatchKitApp.app/TheDodoWatchKitApp&#39;.&#34;
</code></pre>

<p>要归档和导出的 Makefile 如下所示:</p>

<pre><code>/usr/bin/xcodebuild -verbose -verbose -workspace &#39;rebelmouse.xcworkspace&#39;-scheme TheDodo -configuration &#34;App Store&#34; -sdk &#39;iphoneos&#39; -archivePath /tmp/TheDodo.xcarchive -derivedDataPath /tmp/ROJECT.Ji9vwyH0 APPLICATION_BUILD_VERSION=2456 archive

/usr/bin/xcodebuild -exportArchive -exportFormat ipa -archivePath /tmp/TheDodo.xcarchive -exportPath /tmp/TheDodo.ipa -exportWithOriginalSigningIdentity
</code></pre>

<p>非常感谢任何建议/帮助。提前致谢。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>回答这个问题以防其他人被困在同一条船上。 </p>

<p>在 Xcode 7.0 中,xcodebuild 获得了一个新的命令行选项来导出存档,即 <strong>exportOptionsPlist</strong> ,这需要配置存档的 plist 的完整路径。</p>

<p>您不再需要设置 <code>-exportFormat</code></p>

<p><code>xcodebuild --help</code> 列出 plist 的详细信息。 </p>

<p>对于企业构建,我使用这个 plist</p>

<pre><code>&lt;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&gt;
&lt;!DOCTYPE plist PUBLIC &#34;-//Apple Computer//DTD PLIST 1.0//EN&#34; &#34;http://www.apple.com/DTDs/PropertyList-1.0.dtd&#34;&gt;
&lt;plist version=&#34;1.0&#34;&gt;
&lt;dict&gt;
    &lt;key&gt;method&lt;/key&gt;
    &lt;string&gt;enterprise&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;
</code></pre>

<p>对于 App Store 版本,将 <code>enterprise</code> 替换为 <code>app-store</code>。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - xcodebuild 存档未通过 ITMS 验证,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/31996464/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/31996464/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - xcodebuild 存档未通过 ITMS 验证