【iOS开发】带有 Extension Target 的 App,如何签名打包

�Extension Target

如果我们要开发一款类似 AdBlock 的应用,就需要添加一个 Extension Target,如上图。
添加完了之后,你的项目看起来是这个样子的:


Xcode ScreenShot

那么就会有两个 Target,这个时候,怎么进行 CodeSign,折磨了我一段时间,分享出来。

1.把你的两个 TARGET 的 Bundle Identifier 写成【开头一样的】。在 Member Center 申请发布到 AppStore 的 Provisioning Profile 的时候,只要申请一份就可以了,�即给和你的 App 同名的那个申请。
(假如你的App的名字是 wechat,主 Target 的 Bundle ID 写成 com.xky.wechat, Extension Target 的 Bundle ID 写成 com.xky.wechat.ex, 那么你的 Provisioning Profile 只要和 com.xky.wechat 捆绑; "com.xky.wechat.ex" 除了要写在相应的 Target 上,不需要再有与其相匹配的 Provisioning Profile)

2.两个 TARGET 的 Build Settings->Code Signing->Provisioning Profile 那里都选择 Automatic


Paste_Image.png

3.真正自己设置 Build Settings->Code Signing->Provisioning Profile 是要进行 Develop(测试)还是 Distribution(打包),在 PROJECT 那里设置:
(让 TARGET 的设置自动化,否则你每次改动设置都要同时改3个)


Paste_Image.png
上一篇:centos7.6静默安装oracle 11G RAC


下一篇:Linux运维(07):Shell 入门学习