ios 如何从 Xcode 获取 ipa 文件以在真实设备中运行 iPhone 应用程序?

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

How to get ipa file from Xcode to run an iPhone app in real device?

iphoneiosxcodedistributionipa

提问by Sanchit Paurush

My client asked me to get the review of the app on which I am working. So, I want to get the ipa file and mobile provision file from Xcode 4.2 to share my app to run in real device. I have a paid account of apple with me. Please tell me the procedure to get it.

我的客户要求我查看我正在使用的应用程序的评论。所以,我想从 Xcode 4.2 获取 ipa 文件和移动配置文件来共享我的应用程序以在真实设备中运行。我有一个苹果的付费账户。请告诉我获取它的程序。

Thanks in advance.

提前致谢。

回答by Parth Bhatt

STEP-1:

第1步:

You need to refer steps for AdHoc Distribution

您需要参考AdHoc Distribution 的步骤

I think you need to login with your credentials at Developer Apple Login

我认为您需要在Developer Apple Login 上使用您的凭据登录

Once you are logged in go through this link and read through it step by step.

登录后,请访问此链接并逐步阅读。

I think this is the best solution you can get as this documentation guide is given by Apple

我认为这是您可以获得的最佳解决方案,因为此文档指南由 Apple 提供

https://developer.apple.com/ios/manage/certificates/team/howto.action

https://developer.apple.com/ios/manage/certificates/team/howto.action

This has multiple steps like:

这有多个步骤,例如:

1. Generating a Certificate Signing Request

2. Submitting a Certificate Signing Request for Approval

3. Approving Certificate Signing Requests

4. Downloading and Installing Development Certificates

5. Saving your Private Key and Transferring to other Systems

I think if you read all this steps on the apple documentation at the given link then you don't need to refer to any other guide.

我认为如果您在给定链接处阅读了苹果文档中的所有这些步骤,那么您就不需要参考任何其他指南。

STEP-2:

第2步:

Then just you need to download your certificates and provisioning profile.

然后您只需要下载您的证书和配置文件。

STEP-3:

第 3 步:

Just set the profile into your Project and Target Settings and then put proper Entitlements using "Entitlements.plist".

只需将配置文件设置到您的项目和目标设置中,然后使用“Entitlements.plist”放置适当的权利。

STEP-4:

第四步:

Once you have done that, just set up your project in AdHoc Scheme.

完成后,只需在 AdHoc Scheme 中设置您的项目。

STEP-5:

第 5 步:

Clean your Project.

清理你的项目。

STEP-6:

第 6 步:

Go to Product -> Click on Build For -> "Build For Archiving"

转到产品 -> 单击构建 ->“为存档构建”

STEP-7:

第 7 步:

Product -> Archive

产品 -> 存档

Now your Archive can be obtained in your Organizerwhere in you can save it to disk with an IPA extension and send it your client.

现在您的档案可以在您的管理器中获得,您可以在其中使用 IPA 扩展名将其保存到磁盘并将其发送给您的客户端。

EDIT:

编辑:

Here are some of the useful links you can refer to for creating provisioning profile and IPA file:

您可以参考以下一些有用的链接来创建配置文件和 IPA 文件:

Create IPA file in Xcode 4.2, iOS 5.0 Beta

在 Xcode 4.2、iOS 5.0 Beta 中创建 IPA 文件

http://www.makebetterthings.com/iphone/how-to-create-ipa-file-for-your-iphone-app-xcode-build-and-archive/

http://www.makebetterthings.com/iphone/how-to-create-ipa-file-for-your-iphone-app-xcode-build-and-archive/

http://www.wikihow.com/Create-a-Provisioning-Profile-for-iPhone

http://www.wikihow.com/Create-a-Provisioning-Profile-for-iPhone

Create provisioning profile in iphone application

在 iphone 应用程序中创建配置文件

Hope this helps you.

希望这对你有帮助。

回答by Srikar Appalaraju

If you want to test application on device, then you need to create debug profile for it. You need to get it for your device from the provisioning section of developer portal. If you are creating the distribution profile, then you need to put the generated ipa file from build folder to itunes to install it on device.

如果要在设备上测试应用程序,则需要为其创建调试配置文件。您需要从开发人员门户的配置部分为您的设备获取它。如果您正在创建分发配置文件,那么您需要将生成的 ipa 文件从构建文件夹放入 iTunes 以将其安装到设备上。

Then you can install the application on device. But in that case you will not be able to see the logs.

然后您可以在设备上安装该应用程序。但在这种情况下,您将无法看到日志。

So if you want to see the logs in Xcode console, Create a developer provisioning profile for the device & install it on XCode & then run the code on device using Xcode.

因此,如果您想在 Xcode 控制台中查看日志,请为设备创建开发人员配置文件并将其安装在 XCode 上,然后使用 Xcode 在设备上运行代码。

Maybe I think this is the entitlements.plist problem please follow the steps

也许我认为这是 entitlements.plist 问题请按照步骤操作

In XCode, go to "new file" and select "code signing" in left box. Select the "Entitlements" file type. And change the name to "Entitlements.plist". Give the name in project getinfo entitlements plist please check the image below

在 XCode 中,转到“新文件”并在左侧框中选择“代码签名”。选择“权利”文件类型。并将名称更改为“Entitlements.plist”。在项目 getinfo entitlements plist 中给出名称,请查看下图

enter image description here

在此处输入图片说明

回答by Jesse Black

? Get their device ID and add their device to "Devices" in your iOS Provisioning Portal
Create or edit a distribution profile to include their device (wildcard app id or your app's app id)
? In Xcode: Product -> Archive
? In Xcode's Organizer: Go to archives and "Share" your archive. This creates an ipa that you can give to your client
? The client can install it in iTunes by adding the ipa and syncing apps (I haven't done this last step in a while)

? 获取他们的设备 ID 并将他们的设备添加到您的 iOS 配置门户中的“设备”
创建或编辑分发配置文件以包含他们的设备(通配符应用程序 ID 或您应用程序的应用程序 ID)
? 在 Xcode 中:产品 -> 存档
?在 Xcode 的管理器中:转到档案并“共享”您的档案。这将创建一个您可以提供给您的客户的 ipa
?客户端可以通过添加 ipa 和同步应用程序在 iTunes 中安装它(我有一段时间没有完成最后一步)

OR

或者

Get to know testflight. Using testflight will replace the final step above and streamline the installation process for your client.

了解testflight。使用 testflight 将取代上述最后一步,并为您的客户简化安装过程。

回答by Abdullah Md. Zubair

After build with your provisioning profile or distribution for device(not simulator). You can follow this tutorial.

使用您的配置文件或设备分发版(不是模拟器)构建后。您可以按照本教程进行操作。

回答by SudoPlz

It can be done, in fact I just did it.

是可以做到的,事实上我只是做到了。

After Xcode 6 you have to go to:

在 Xcode 6 之后,您必须转到:

  • Product-->Archive

  • Then wait for it to finish. Then on the screen that pops up right click on your newly created archive-->Show file in finder

  • Then head there with a terminal and run this command on that dir:

  • 产品-->档案

  • 然后等待它完成。然后在弹出的屏幕上右键单击您新创建的存档--> 在查找器中显示文件

  • 然后使用终端前往那里并在该目录上运行此命令:

xcodebuild -exportArchive -archivePath <PROJECT_NAME>.xcarchive -exportPath <PROJECT_NAME> -exportFormat ipa -exportProvisioningProfile "Name of Provisioning Profile"

xcodebuild -exportArchive -archivePath <PROJECT_NAME>.xcarchive -exportPath <PROJECT_NAME> -exportFormat ipa -exportProvisioningProfile "Name of Provisioning Profile"

DONE

完毕

For example this command for me was:

例如,这个命令对我来说是:

xcodebuild -exportArchive -archivePath ACCESS\ 04-02-16\ 02.21.xcarchive/ -exportPath MyTestApp -exportFormat ipa -exportProvisioningProfile "iOS Team Provisioning Profile: eu.sudoplz.myTestApp"

xcodebuild -exportArchive -archivePath ACCESS\ 04-02-16\ 02.21.xcarchive/ -exportPath MyTestApp -exportFormat ipa -exportProvisioningProfile "iOS Team Provisioning Profile: eu.sudoplz.myTestApp"

This created a MyTestApp.ipafile for me.

MyTestApp.ipa为我创建了一个文件。