ios Xcode 4:创建 IPA 文件而不是 .xcarchive

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5265292/
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-08-30 19:11:23  来源:igfitidea点击:

Xcode 4: create IPA file instead of .xcarchive

iosxcodexcode4

提问by Manni

In Xcode 3.2.5 I use "Build And Archive" to create an IPA file. In Xcode 4 you can use "Product -> Archive" to archive an application in an .xcarchive bundle.

在 Xcode 3.2.5 中,我使用“Build And Archive”来创建 IPA 文件。在 Xcode 4 中,您可以使用“产品 -> 存档”将应用程序存档到 .xcarchive 包中。

How can I create an .ipa file with Xcode 4?

如何使用 Xcode 4 创建 .ipa 文件?

回答by eploko

Creating an IPA is done along the same way as creating an .xcarchive: Product -> Archive. After the Archive operation completes, go to the Organizer, select your archive, select Share and in the "Select the content and options for sharing:" pane set Contents to "iOS App Store Package (.ipa) and Identity to iPhone Distribution (which should match your ad hoc/app store provisioning profile for the project).

创建 IPA 的方式与创建 .xcarchive 的方式相同:产品 -> 存档。存档操作完成后,转到管理器,选择您的存档,选择共享,然后在“选择共享的内容和选项:”窗格中将内容设置为“iOS App Store 包 (.ipa) 和 iPhone 分发标识(其中应该与项目的临时/应用程序商店配置文件匹配)。

Chances are the "iOS App Store Package (.ipa)" option may be disabled. This happens when your build produces more than a single target: say, an app anda library. All of them end up in the build products folder and Xcode gets na?vely confused about how to package them bothinto an .ipa file, so it merely disables the option.

可能会禁用“iOS App Store Package (.ipa)”选项。当您的构建生成多个目标时会发生这种情况:例如,一个应用程序一个库。所有这些最终都在 build products 文件夹中,Xcode 对如何将它们打包到一个 .ipa 文件中感到很困惑,所以它只是禁用了该选项。

A way to solve this is as follows: go through build settings for each of the targets, except the application target, and set Skip Install flag to YES. Then do the Product -> Archive tango once again and go to the Organizer to select your new archive. Now, when clicking on the Share button, the .ipa option should be enabled.

解决此问题的一种方法如下:检查每个目标(应用程序目标除外)的构建设置,并将跳过安装标志设置为 YES。然后再次执行 Product -> Archive tango 并转到 Organizer 以选择您的新存档。现在,当单击“共享”按钮时,应启用 .ipa 选项。

I hope this helps.

我希望这有帮助。

回答by Boris Gafurov

Just setting Skip Install to YES did not work for me. Hopefully this will help somebody.

只是将跳过安装设置为 YES 对我不起作用。希望这会帮助某人。

I went to dependence of my project targets: Coreplot-CocoaTouch. Then went to Coreplot-CocoaTouch Targets. In its Targets opened Build Phases. Then opened Copy Headers. There I had some of headers in Public, some in Private and some in Project. Moved ALL of them to Project.

我去依赖我的项目目标:Coreplot-CocoaTouch。然后转到 Coreplot-CocoaTouch 目标。在其目标中打开了构建阶段。然后打开复制标题。在那里,我有一些公共标题,一些私人标题和一些项目标题。将它们全部移至 Project。

Of course, in Build Settings of Coreplot-CocoaTouch Targets checked that Skip Install was set to YES in Deployment options.

当然,在 Coreplot-CocoaTouch Targets 的 Build Settings 中检查了 Skip Install 在 Deployment options 中是否设置为 YES。

And this time Archive made an archive that could be signed and .ipa produced.

这一次 Archive 制作了一个可以签名并生成 .ipa 的档案。

回答by ohho

For Xcode 4.6 (and Xcode 5) archives

对于 Xcode 4.6(和 Xcode 5)档案

  • In Organizer, right-click an archive, select Show in Finder
  • In Finder, right-click an archive, select Show Package Contents
  • Open the folder Products > Applications
  • The application is there
  • Drag the application into iTunes Apps folder

    enter image description here

  • Right-click on the application in iTunes Apps, select Show in Finder

  • The .ipais there!
  • 在管理器中,右键单击存档,选择在 Finder 中显示
  • 在 Finder 中,右键单击存档,选择显示包内容
  • 打开文件夹产品 > 应用程序
  • 应用程序在那里
  • 将应用程序拖入 iTunes Apps 文件夹

    在此处输入图片说明

  • 右键单击 iTunes 应用程序中的应用程序,选择在 Finder 中显示

  • .ipa那里!

回答by Don Hopkins

I had this same problem, using an old version of the route-me library. I "skipped" all the libraries, and the libraries inside of libraries (proj4), but I still had the same problem. Turns out that route-me and proj4 were installing public header files, even when the libraries were being skipped, which was messing it up in the same way! So I just went into the route-me and proj4 targets "Build Phases" tab, opened "Copy Headers", opened "Public", and dragged those headers from "Public" into "Project". Now they don't get installed in $(BUILD)/usr/local/include, and I'm able to make an ipa file from the archive!

我有同样的问题,使用旧版本的 route-me 库。我“跳过”的所有库,和库(proj4)内的图书馆,但我仍然有同样的问题。结果是 route-me 和 proj4 正在安装公共头文件,即使是在跳过库的时候,这也以同样的方式搞砸了!所以我只是进入 route-me 和 proj4 目标“构建阶段”选项卡,打开“复制标题”,打开“公共”,并将这些标题从“公共”拖到“项目”中。现在它们没有安装在 $(BUILD)/usr/local/include 中,我可以从存档中制作一个 ipa 文件!

I hope Apple fixes this horrible usability problem with XCode. It gives absolutely no indication of what's wrong, it just doesn't work. I hate dimmed out controls that don't tell you anything about why they're dimmed out. How about instead of ignoring clicks, the disabled controls could pop up a message telling you why the hell they're disabled when you click on them in frustration?

我希望 Apple 用 XCode 解决这个可怕的可用性问题。它绝对没有任何问题的迹象,它只是不起作用。我讨厌变暗的控件,它们不会告诉您有关变暗原因的任何信息。不如忽略点击,禁用的控件可以弹出一条消息,告诉您为什么当您沮丧地单击它们时它们被禁用了?

回答by Joshua Smith

In the organizer you can click Share and save as iOS App Store Package(.ipa). You may also have to select 'Archive' from the 'Product' menu to generate the archive in the Organizer. Lastly, I think you have to have a properly signed archived build to do this.

在管理器中,您可以单击共享并另存为 iOS App Store Package(.ipa)。您可能还必须从“产品”菜单中选择“存档”才能在管理器中生成存档。最后,我认为你必须有一个正确签名的存档版本才能做到这一点。

回答by Snowcrash

Assuming you've done a successful Product > Archive then, from Organizer (Shift Apple 2) click Archives.

假设您已经成功完成了 Product > Archive,然后从 Organizer (Shift Apple 2) 单击 Archives。

Select your Archive. Select Share. In the "Select the content and options for sharing:" pane set Contents to "iOS App Store Package (.ipa) and Identity to iPhone Distribution.

选择您的存档。选择共享。在“选择共享的内容和选项:”窗格中,将“内容”设置为“iOS App Store 包 (.ipa),并将身份设置为 iPhone 分发。

Click Next, enter an App name and click Save.

单击下一步,输入应用程序名称并单击保存。

Full gory details with screenshots are here: Xcode4UserGuide

带有截图的完整细节在这里: Xcode4UserGuide

回答by Inder Kumar Rathore

One who has tried all other answers and had no luck the please check this check box, hope it'll help (did the trick for me xcode 6.0.1)

一个已经尝试了所有其他答案但没有运气的人,请选中此复选框,希望它会有所帮助(为我解决了 xcode 6.0.1 的问题)

enter image description here

在此处输入图片说明

回答by Shrolox

I went threw the same problem. None of the answers above worked for me, but i ended finding the solution on my own. The ipa file wasn't created because there was library files (libXXX.a) in Target-> Build Phases -> Copy Bundle with resources

我去扔了同样的问题。上面的答案都不适合我,但我最终自己找到了解决方案。未创建 ipa 文件,因为 Target-> Build Phases -> Copy Bundle with resources 中有库文件 (libXXX.a)

Hope it will help someone :)

希望它会帮助某人:)

回答by vivek

If it is a game(may be app also) and you have some static libraries like cocos2d or other third party library ... then you just have to select *ONLY THE*static library (NOT THE APP) and in its build settings under Deployment , set Skip Install flag to YESand Archive it dats it...!!

如果它是一个游戏(也可能是应用程序)并且您有一些静态库,如 cocos2d 或其他第三方库……那么您只需要选择*只有*静态库(不是应用程序)并在其构建设置下部署,将跳过安装标志设置为YES并将其存档...!!

回答by Graeme Wicksted

I had the same problem... Had to recreate the project from scratch.

我遇到了同样的问题......不得不从头开始重新创建项目。

Note: my project was created in XCode 3.1 and was linking against a static library that was being built as a subproject (to a common destination). I changed this to build the source instead when I recreated the XCode project in XCode 4.

注意:我的项目是在 XCode 3.1 中创建的,并且正在链接到作为子项目(到公共目标)构建的静态库。当我在 XCode 4 中重新创建 XCode 项目时,我将其更改为构建源代码。

Now doing a Product/Archive/Share... gets the option of "iOS App Store Package (.ipa)" directly above "Application" (which is now greyed out) and "Archive" (which exports the .xcarchive).

现在做一个产品/存档/共享......在“应用程序”(现在变灰)和“存档”(导出.xcarchive)正上方获得“iOS App Store Package (.ipa)”选项。