ios模拟器 应用切换_在模拟器上共享并安装iOS应用

ios模拟器 应用切换

As an iOS developer, we know both Xcode and iPhone are fundamental building blocks to run and test our application. What if we want to share our application to someone who doesn’t have a real device. Maybe you want to install the build in the simulator without building again & run it using Xcode.

作为iOS开发人员,我们知道Xcode和iPhone都是运行和测试我们的应用程序的基本构件。 如果我们想与没有真实设备的人共享我们的应用程序怎么办。 也许您想在不重新构建的情况下将构建安装在模拟器中,并使用Xcode运行它。

Let’s discuss how to achieve this here:

让我们在这里讨论如何实现这一目标:

Let’s create a sample application and I have chosen here device iPhone XS Max and OS version is 13.3 for development.

让我们创建一个示例应用程序,我在这里选择了设备iPhone XS Max,并且OS版本为13.3进行开发。

Build the sample app. You can see the executable inside Product folder.

生成示例应用程序。 您可以在“产品”文件夹中看到可执行文件。

Image for post

Refer to the above image where we got BuildReferences.app as an executable file and save it in Desktop.

请参考上图,其中我们将BuildReferences.app作为可执行文件保存在桌面中。

From Xcode menu Open Developer Tool -> Simulator

从Xcode菜单打开Developer Tool-> Simulator

Image for post

From simulator select the device where you want to install the application

从模拟器中选择要在其中安装应用程序的设备

Image for post

Open the Terminal application and execute the following command:

打开终端应用程序并执行以下命令:

xcrun simctl list

The above command lists out all the available simulators. simctl command controls the instances of the simulators.

上面的命令列出了所有可用的模拟器。 simctl命令控制模拟器的实例。

Image for post

Make a note on the UDID of the simulator which you have selected previously while building the sample app.

在构建示例应用程序时,请记下您先前选择的模拟器的UDID。

We can see the word (Booted) to identify the selected device.

我们可以看到单词(Booted)来标识所选设备。

The last step will be to install the BuildReferences.app inside the simulator which we have selected in the previous step. To do that again in Terminal execute the following command.

最后一步是将BuildReferences.app安装在我们在上一步中选择的模拟器中。 要在终端中再次执行此操作,请执行以下命令。

xcrun simctl install 351036B2-85AA-4E97-96AD-03A2FA1FD56E ~/Desktop/BuildReferences.app

That’s it. You can now see the build started installing on the selected simulator.

而已。 现在,您可以看到该构建开始在所选模拟器上安装。

Happy coding!!!

编码愉快!

翻译自: https://medium.com/macoclock/share-install-the-ios-app-on-simulator-7ad35ccfe871

ios模拟器 应用切换

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值