如何在 XCode 4.3 上制作 IPA?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9350972/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to make an IPA on XCode 4.3?
提问by soheilpro
I have a Mac OS X Lion setup with XCode 4.3. I am not a registered Apple developer.
我有一个带有 XCode 4.3 的 Mac OS X Lion 设置。我不是注册的 Apple 开发人员。
I told, via the plist files: /Applications/Xcode.App/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist
and
/Applications/Xcode.App/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/SDKSettings.plist
, XCode not to require codesigning.
我告诉,通过 plist 文件:/Applications/Xcode.App/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist
和
/Applications/Xcode.App/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/SDKSettings.plist
,XCode 不需要协同设计。
I then compiled my project, just a basic iPhone app project, it ran well in simulator. I could build and archive it, then sign it using a self-created certificate and the archive appeared in the Organizer.
然后我编译了我的项目,只是一个基本的 iPhone 应用程序项目,它在模拟器中运行良好。我可以构建和存档它,然后使用自创建的证书对其进行签名,并且存档出现在组织者中。
Nothing strange for the moment, but there comes the problem: I have no "Share" button in the organizer. I absolutely need to make an IPA file out of my project if I want it to work under an iPhone as it won't accept xcarchive files. I only get the "Validate" and "Distribute" buttons which both require to be a registered Apple developer. But, no "Share" button which enables building an IPA... for free.
目前没有什么奇怪的,但问题来了:我在组织者中没有“共享”按钮。如果我想让它在 iPhone 下工作,我绝对需要从我的项目中制作一个 IPA 文件,因为它不接受 xcarchive 文件。我只得到“验证”和“分发”按钮,这两个按钮都需要注册 Apple 开发人员。但是,没有可以免费构建 IPA 的“共享”按钮。
I have gone through XCode settings but nothing seemed to help me there. Even the documentation says a Share button is available in XCode 4.3, so my question is: Why don't I get the possibility to make an IPA? IS there any workaround to get this Share button or make an IPA out of the xcarchive via any command line or whatever?
我已经完成了 XCode 设置,但似乎没有任何帮助。甚至文档说 XCode 4.3 中提供了一个共享按钮,所以我的问题是:为什么我不能制作 IPA?是否有任何解决方法可以通过任何命令行或其他方式获取此“共享”按钮或从 xcarchive 中制作 IPA?
回答by soheilpro
Here's how you can make an IPA in XCode 4.3:
以下是在 XCode 4.3 中制作 IPA 的方法:
To Disable Code Signing:
禁用代码签名:
- Go to
/Applications
. - Right click on XCode and select 'Show Package Contents'.
- Copy
Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/SDKSettings.plist
to your desktop. (Make sure to actually copy and paste. No drag and drop) - Open it and under
DefaultProperties
setCODE_SIGNING_REQUIRED
toNO
. - Copy it back and replace the original file.
- Restart XCode.
- Open your project.
- In Project Navigator select your project and open
Build Settings
section of your porject (and not any particular target) - Under
Code Signing
findCode Signing Identity
and for bothDebug
andRelease
modes setAny iOS SKD
toDon't Code Sign
. - Now you should be able to build your project without any errors.
- 去
/Applications
。 - 右键单击 XCode 并选择“显示包内容”。
- 复制
Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/SDKSettings.plist
到桌面。(确保实际复制和粘贴。不要拖放) - 打开它并
DefaultProperties
设置CODE_SIGNING_REQUIRED
为NO
。 - 将其复制回来并替换原始文件。
- 重新启动 XCode。
- 打开您的项目。
- 在 Project Navigator 中选择您的项目并打开项目的
Build Settings
部分(而不是任何特定目标) - 在
Code Signing
findCode Signing Identity
和 for bothDebug
和Release
模式下设置Any iOS SKD
为Don't Code Sign
。 - 现在您应该能够在没有任何错误的情况下构建您的项目。
To make an IPA:
制作 IPA:
- In 'Project Navigator' select Products
- Right click on
[NameOfYourProject].app
and select 'Show in Finder'. - Create a folder and name it
Payload
- Move
[NameOfYourProject].app
toPayload
. - Compress
Payload
and rename it to[NameOfYourProject].ipa
- 在“项目导航器”中选择产品
- 右键单击
[NameOfYourProject].app
并选择“在 Finder 中显示”。 - 创建文件夹并命名
Payload
- 移动
[NameOfYourProject].app
到Payload
。 - 压缩
Payload
并重命名为[NameOfYourProject].ipa
回答by kross
You should be able to get an IPA by clicking 'Distribute...' in Organizer->Archives, and choosing to 'Save for Enterprise or Ad-Hoc Deployment'.
您应该能够通过在 Organizer->Archives 中单击“Distribute...”并选择“Save for Enterprise or Ad-Hoc Deployment”来获取 IPA。
回答by Gal Blank
Beginning iOs 5.1 Apple moved their files from /Developer/... to XCode->Show Package Content In order to export codesign_allocate correctly run this line on your Mac terminal : export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
开始 iOs 5.1 Apple 将他们的文件从 /Developer/... 移至 XCode->Show Package Content 为了正确导出 codesign_allocate 在 Mac 终端上运行此行:export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Platforms /iPhoneOS.platform/Developer/usr/bin/codesign_allocate