如何在 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:15:48  来源:igfitidea点击:

How to make an IPA on XCode 4.3?

xcodeipa

提问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.plistand /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:

禁用代码签名:

  1. Go to /Applications.
  2. Right click on XCode and select 'Show Package Contents'.
  3. Copy Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/SDKSettings.plistto your desktop. (Make sure to actually copy and paste. No drag and drop)
  4. Open it and under DefaultPropertiesset CODE_SIGNING_REQUIREDto NO.
  5. Copy it back and replace the original file.
  6. Restart XCode.
  7. Open your project.
  8. In Project Navigator select your project and open Build Settingssection of your porject (and not any particular target)
  9. Under Code Signingfind Code Signing Identityand for both Debugand Releasemodes set Any iOS SKDto Don't Code Sign.
  10. Now you should be able to build your project without any errors.
  1. /Applications
  2. 右键单击 XCode 并选择“显示包内容”。
  3. 复制Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/SDKSettings.plist到桌面。(确保实际复制和粘贴。不要拖放)
  4. 打开它并DefaultProperties设置CODE_SIGNING_REQUIREDNO
  5. 将其复制回来并替换原始文件。
  6. 重新启动 XCode。
  7. 打开您的项目。
  8. 在 Project Navigator 中选择您的项目并打开项目的Build Settings部分(而不是任何特定目标)
  9. Code SigningfindCode Signing Identity和 for bothDebugRelease模式下设置Any iOS SKDDon't Code Sign
  10. 现在您应该能够在没有任何错误的情况下构建您的项目。

To make an IPA:

制作 IPA:

  1. In 'Project Navigator' select Products
  2. Right click on [NameOfYourProject].appand select 'Show in Finder'.
  3. Create a folder and name it Payload
  4. Move [NameOfYourProject].appto Payload.
  5. Compress Payloadand rename it to [NameOfYourProject].ipa
  1. 在“项目导航器”中选择产品
  2. 右键单击[NameOfYourProject].app并选择“在 Finder 中显示”。
  3. 创建文件夹并命名 Payload
  4. 移动[NameOfYourProject].appPayload
  5. 压缩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