分享

ios

 Tornador 2016-08-12

I finally managed to export ipa files via xcodebuild. Since the xctool is built upon xcodebuild, this answer might help.

First of all, when you create an extension, the extension's target will be embedded into your main app's scheme.

enter image description here

So, there is no need to use two schemes.

Then, in your project settings page, create a new configuration, say AdHoc. And then you can set a new Provisioning Profile in both of your target's build settings.

enter image description here

(project settings)

enter image description here

(the build settings of one target)

Then set the right provisioning profiles for your targets (And you'd better set the code sign identity to automatic, so that Xcode can determine which code sign identity is to be used).

Next step, you can archive your app using xcodebuild with the new configuration you just created above:

xcodebuild -project Extension\ Demo.xcodeproj -scheme Extension\ Demo -sdk iphoneos -archivePath ./Build/extension-demo.xcarchive -configuration AdHoc archive

In this step, the codesign will sign two of your targets separately by the provisioning profiles you specified.

Finally, export the .xcarchive file to ipa, again using xcodebuild;

xcodebuild -exportArchive -archivePath ./Build/extension-demo.xcarchive -exportPath ./Build/extension-demo.ipa -exportWithOriginalSigningIdentity

Notice that -exportWithOriginalSigningIdentity is set, so that xcodebuild will not re-sign your ipa, and the code signature in the xcarchive file is preserved.

answered Dec 24 '14 at 13:47
Hokuang
1,1462919
    
"Then set the right provisioning profiles for your targets" how to do it via xcodebuild command line? – Sergey Kopanev Jan 12 '15 at 17:17
1  
You don't do this with xcodebuild command, instead you need to set them in Xcode's Build Settings in the configuration that you created in step 1 (see pic 3). You only need to specify the configuration to xcodebuild and don't care what provisioning profile it is. – Hokuang Jan 13 '15 at 3:33
    
may be you right. I've just put it as you said. Not found other ways. Thanks. – Sergey Kopanev Jan 14 '15 at 14:18
    
It does not work for keyboard extension – Quanlong Jun 1 '15 at 8:26

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多