xcode 为 iPhone 创建 .ipa

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

Create .ipa for iPhone

iphonexcodearchiveipa

提问by Tony Eichelberger

I developed one application for iPhone. After I build I got .app file in build folder. My application name is Myapp, then i got Myapp.app file in the build folder.

我为 iPhone 开发了一个应用程序。构建后,我在构建文件夹中得到了 .app 文件。我的应用程序名称是 Myapp,然后我在 build 文件夹中得到了 Myapp.app 文件。

My problem is i want to create the .ipa file. how is that.. it is for to install jailbraked iPhone..

我的问题是我想创建 .ipa 文件。那是怎么回事..它是为了安装越狱的iPhone..

回答by Tony Eichelberger

  1. Create a folder named Payload.
  2. Copy Myapp.app(from products of your project) into the Payload directory.
  3. Right click and Compressthe Payload directory.
  4. Rename the zip file to Myapp.ipa.
  1. 创建一个名为Payload的文件夹。
  2. Myapp.app(来自您项目的产品)复制到 Payload 目录中。
  3. 右键单击并压缩Payload 目录。
  4. 将 zip 文件重命名为Myapp.ipa

** Update ** This answer is very old. Use Xcode to build .ipa archives now. (Product > Archive)

** 更新 ** 这个答案很旧。现在使用 Xcode 构建 .ipa 档案。(产品 > 档案)

回答by Yu-Sen Han

Run Script

运行脚本

/bin/sh

/bin/sh

mkdir $CONFIGURATION_BUILD_DIR/Payload
cp -R $CONFIGURATION_BUILD_DIR/$PRODUCT_NAME.app $CONFIGURATION_BUILD_DIR/Payload
cp $CONFIGURATION_BUILD_DIR/$PRODUCT_NAME.app/iTunesArtwork $CONFIGURATION_BUILD_DIR
cd $CONFIGURATION_BUILD_DIR
/usr/bin/zip -r $PRODUCT_NAME.ipa Payload iTunesArtwork
rm -rf Payload iTunesArtwork
exit 0

回答by Guillaume

With Xcode 4, there is now a way more easy way:
In the menu bar, go to Product > Archive.

在 Xcode 4 中,现在有一种更简单的方法:
在菜单栏中,转到产品 > 存档。

Xcode archive menu screenshot
The organizer will then open in the Archivestab, and you will be able to save an IPA using the Share…button.

Xcode 存档菜单截图
然后,组织者将在“档案”选项卡中打开,您将能够使用“共享...”按钮保存 IPA 。

If the Archive menu item is disabled, make sure you have the scheme set to iOS deviceand not the iPhone Simulator. You don't have to have a device plugged in, though.

如果存档菜单项被禁用,请确保您将方案设置为iOS 设备而不是iPhone Simulator。不过,您不必插入设备。

I also wrote a script to do this from the command line: xcodearchive. It works similar to xcodebuild, but generates an IPA.

我还编写了一个脚本来从命令行执行此操作:xcodearchive。它的工作原理类似于 xcodebuild,但会生成 IPA。

回答by Durai Amuthan.H

Signing Part:

签约部分:

This part is required for non-jailbroken phone and rest of the steps are same

非越狱手机需要此部分,其余步骤相同

  1. Open Terminal and enter the following commands
  1. 打开终端并输入以下命令

codesign -f -s "Code signing certificate name" appNamewithextension

example
codesign -f -s "iPhone Developer: Durai Amuthan" sample.app

codesign -f -s "代码签名证书名称" appNamewithextension

示例代码
-f -s “iPhone 开发者:Durai Amuthan”sample.app

  1. Verify it is signed using the following command
  1. 使用以下命令验证它是否已签名

codesign -verify AbsolutePath_with_app_name

codesign -verify AbsolutePath_with_app_name

ipa creation Part:

ipa创建部分:

Way 1:

方式一:

1.Create a folder named Payload and copy the .app into it

1.创建一个名为Payload的文件夹,将.app复制进去

2.compress it and you'll get Payload.zip

2.压缩它,你会得到Payload.zip

3.Now Change the extension from zip to ipa that's it

3.现在将扩展名从zip更改为ipa就是这样

mkdir Payload
cp -R MyAppName.app Payload/
zip -r -s 64 Payload.zip Payload/
mv Payload.zip MyAppName.ipa

Way 2:

方式二:

Drag and drop the .app in iTunes that'll create the iPa for you

将 .app 拖放到 iTunes 中,它将为您创建 iPa

Installation part:

安装部分:

  • If you had Tried the Way 1 in previous step then Drag and drop the .ipa in iTunes

  • Choose the device in iTunes and click install and apply the sync that's it

  • 如果您在上一步中尝试了方式 1,则将 .ipa 拖放到 iTunes 中

  • 在 iTunes 中选择设备,然后单击安装并应用它的同步

回答by Rahul Mathur

Follow the following steps

请按照以下步骤操作

  • Upload your app file as a zip on www.diawi.com

  • Open the diawi url in your web browser.

  • You will find download application option there. Download the file and it will be downloaded as an IPA.
  • 在 www.diawi.com 上以 zip 格式上传您的应用程序文件

  • 在您的网络浏览器中打开 diawi 网址。

  • 您会在那里找到下载应用程序选项。下载文件,它将作为 IPA 下载。

回答by Alex Nguyen

Also, if you want to include the logo file, add the icon to the directory and name it "iTunesArtwork". compress that along with the Payload directory that has the .app file in it.

此外,如果您想包含徽标文件,请将图标添加到目录并将其命名为“iTunesArtwork”。将其与包含 .app 文件的 Payload 目录一起压缩。