任何人都可以在模拟器中运行的 xcode 构建/归档应用程序

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

xcode build/archive app for anyone to run in a simulator

iosxcodecordovabuildsimulator

提问by Johnny Major

I am trying to figure out how I can build/archive my iOS application in xcode so that I can send it to anyone and they can run in it a simulator. I thought I could just build it and run it in the simulator and pull the .app file however I have no luck. I would like to build it so anyone I give it to can run it in any simulator using the phonegap ios-sim.

我想弄清楚如何在 xcode 中构建/归档我的 iOS 应用程序,以便我可以将它发送给任何人,他们可以在模拟器中运行。我以为我可以构建它并在模拟器中运行它并拉出 .app 文件,但是我没有运气。我想构建它,以便我提供给它的任何人都可以使用 phonegap ios-sim 在任何模拟器中运行它。

Any information would be great!

任何信息都会很棒!

Thanks

谢谢

回答by Elmue

All answers here are wrong.

这里所有的答案都是错误的。

You cannot run an .IPA file on the simulator. The simulator runs files which are compiled for the x86 processor, while IPA files are compiled for the ARM processor in the iPhone. Additionally .IPA files must contain a valid certificate while apps for the simulator do NOT need a certificate.

您不能在模拟器上运行 .IPA 文件。模拟器运行的文件是为 x86 处理器编译的,而 IPA 文件是为 iPhone 中的 ARM 处理器编译的。此外,.IPA 文件必须包含有效证书,而模拟器的应用程序不需要证书。

After building the app, go to the left side navigator bar, select Products > appName.app, right click it and select 'Show in Finder'. Finder will show the .app file and you can send the file to your colleague / client and ask them to drag and drop it into iOS Simulator.

构建应用程序后,转到左侧导航栏,选择产品 > appName.app,右键单击它并选择“在 Finder 中显示”。Finder 将显示 .app 文件,您可以将该文件发送给您的同事/客户,并要求他们将其拖放到 iOS 模拟器中。

Get ios .app folder for simulator

获取模拟器的 ios .app 文件夹

回答by Jeremy Huddleston Sequoia

If you have the .app bundle, you can create a tarball of it and send it to someone else. They can then extract it and use xcrun simctl install <device UDID> <path to app bundle>to install your app in the given simulator device.

如果您有 .app 包,您可以创建它的 tarball 并将其发送给其他人。然后他们可以提取它并用于xcrun simctl install <device UDID> <path to app bundle>在给定的模拟器设备中安装您的应用程序。

回答by Axel

  1. Build the app in simulator, then locate the simulator data folder. You can get the list of simulator UDID by typing instruments -s devicesin Terminal. The UDID is the string between the square brackets. Locate your finder to ~/Library/Developer/CoreSimulator/Devices/[Simulator UDID]

  2. Inside your simulator data folder, locate to data/Containers/Bundle/Application, you will see some folder there if you have multiple apps built before, open them one by one and find the one with your app name inside.

  3. Compress the app_name.appand send it to others. Ask other to use the command instruments -s devicesin terminal to find the UDID as well.

  4. Open Xcode and the selected simulator, then open terminal, type xcrun simctl install <Device UDID> <Path to unzipped app_name.app>

  1. 在模拟器中构建应用程序,然后找到模拟器数据文件夹。您可以通过instruments -s devices在终端中键入来获取模拟器 UDID 的列表。UDID 是方括号之间的字符串。找到您的查找器~/Library/Developer/CoreSimulator/Devices/[Simulator UDID]

  2. 在模拟器数据文件夹中,定位到data/Containers/Bundle/Application,如果您之前构建了多个应用程序,您将在那里看到某个文件夹,将它们一一打开并找到里面有您的应用程序名称的那个。

  3. 压缩app_name.app并发送给其他人。要求其他人也使用instruments -s devices终端中的命令来查找 UDID。

  4. 打开Xcode和选择的模拟器,然后打开终端,输入 xcrun simctl install <Device UDID> <Path to unzipped app_name.app>

The app should install successfully in the simulator, I wrote a blog post about this with screenshot guide here : https://fluffy.es/how-to-archive-ios-app-for-simulator/

该应用程序应该在模拟器中成功安装,我写了一篇关于这个的博客文章,这里有截图指南:https: //fluffy.es/how-to-archive-ios-app-for-simulator/

回答by fengelhardt

First off you will need a release build (not a dev build) to share the installable simulator .app

首先,您需要一个发布版本(不是开发版本)来共享可安装的模拟器.app

To generate a Release build:

要生成发布版本:

  1. make sure you go into edit scheme (next to the simulator selector)

  2. Under Run change the build configuration to Release

  1. 确保您进入编辑方案(在模拟器选择器旁边)

  2. 在运行下将构建配置更改为发布

Then you can right click the app and go into the DerivedData//Build/Products/Release-iphonesimulator/.app

然后你可以右键单击应用程序并进入 DerivedData//Build/Products/Release-iphonesimulator/.app

Copy the .app and share with whoever has xcode.

复制 .app 并与拥有 xcode 的人共享。

That person then needs to do a few things.

然后那个人需要做一些事情。

  1. Download your app and add it in a location that they can access the path. example: Users/<username>/Downloads/test.app

  2. Get the device ID xcrun simctl list devicesexample 7FAB6CD2-70D0-416F-9C50-4C7C23B2ABCD

  3. With a valid simulator id, run xcrun simctl install 7FAB6CD2-70D0-416F-9C50-4C7C23B2ABCD Users/<username>/Downloads/test.app

  4. The app should install and they should be able to open the app.

  1. 下载您的应用程序并将其添加到他们可以访问路径的位置。例子:Users/<username>/Downloads/test.app

  2. 获取设备 IDxcrun simctl list devices示例7FAB6CD2-70D0-416F-9C50-4C7C23B2ABCD

  3. 使用有效的模拟器 ID,运行 xcrun simctl install 7FAB6CD2-70D0-416F-9C50-4C7C23B2ABCD Users/<username>/Downloads/test.app

  4. 该应用程序应该安装并且他们应该能够打开该应用程序。

回答by BalKrishan Yadav

First of all set proper bundle identifier with build setting and iOS version which is required for run app.

首先,使用运行应用程序所需的构建设置和 iOS 版本设置正确的包标识符。

**

**

For Device

对于设备

** 1.

** 1。

You can Build Archive using and generate ipa

您可以使用并生成 ipa 构建存档

or build app then you will get .app you can drag .app in itune and get .ipa by show in finder.

或构建应用程序,然后您将获得 .app 您可以在 iTunes 中拖动 .app 并通过在 finder 中显示获得 .ipa。

**

**

For Simulator

模拟器用

** 2. path:- /Users/Krishan/Library/Application Support/iPhone Simulator/6.0/ApplicationsOpen above path and zip app folder which you want to share.Now unzip folder paste on same above path app shown in simulator will run successfully.

** 2. 路径:- /Users/Krishan/Library/Application Support/iPhone Simulator/6.0/Applications打开上面的路径并压缩要共享的应用程序文件夹。现在解压文件夹粘贴到模拟器中显示的相同路径应用程序将运行成功地。