简体   繁体   English

如何在Xcode 6 iOS模拟器上安装应用程序

[英]How to install apps on Xcode 6 iOS Simulator

I'm looking for a way to install the mail application on the Xcode 6 iOS Simulator. 我正在寻找一种在Xcode 6 iOS模拟器上安装邮件应用程序的方法。

Additionally, how do I install apps that are already public on the Appstore so that I can run them on the iOS Simulator? 此外,如何在Appstore上安装已公开的应用程序,以便我可以在iOS模拟器上运行它们? Is there a simple way? 有一个简单的方法吗?

The most common way to install an app in the iOS Simulator is to use Xcode to build and install it. 在iOS模拟器中安装应用程序的最常用方法是使用Xcode来构建和安装它。 If you have a simulator app bundle which was built by someone else (or archived), you can install it using simctl: 如果您有一个由其他人(或已存档)构建的模拟器应用程序包,您可以使用simctl安装它:

xcrun simctl install booted /path/to/your.app

Keep in mind, of course, that these apps need to be iOS Simulator apps, not iOS Device apps. 当然,请记住,这些应用程序需要是iOS模拟器应用程序,而不是iOS设备应用程序。

The iOS simulator is a different compiled binary than the app that gets published on the app store. iOS模拟器是与在应用商店中发布的应用程序不同的编译二进制文件。

If you don't have access to the project's source code or simulator binaries, you can't install it on your own simulator. 如果您无法访问项目的源代码或模拟器二进制文件,则无法将其安装在您自己的模拟器上。

In Xcode 8.2, you can now drag an app onto a iOS Simulator window. 在Xcode 8.2中,您现在可以将应用程序拖到iOS模拟器窗口中。 See this blog: https://medium.com/@hollanderbart/new-features-in-xcode-8-2-simulator-fc64a4014a5f 请参阅此博客: https//medium.com/@hollanderbart/new-features-in-xcode-8-2-simulator-fc64a4014a5f

NOTE: The receiver of the simulator app has to boot up the same simulator and iOS version, as what was used to compile the simulator app bundle. 注意:模拟器应用程序的接收器必须启动相同的模拟器和iOS版本,就像用于编译模拟器应用程序包的那样。

To install an app compiled for the simulator, you have to: 要安装为模拟器编译的应用程序,您必须:

  1. Boot up the simulator you want to install the app on (and leave it running for step 2). 启动要安装应用程序的模拟器(并使其继续运行第2步)。
  2. To install StackOverflow.app from your Desktop, write the following in terminal: xcrun simctl install booted ~/Desktop/StackOverflow.app 要从桌面安装StackOverflow.app,请在终端中编写以下内容: xcrun simctl install booted ~/Desktop/StackOverflow.app

You should now instantly see the app icon appear in the simulator (likely appearing on page 2). 您现在应立即看到应用程序图标出现在模拟器中(可能出现在第2页)。


To obtain the simulator app you want to distribute, you can run this command in the Xcode console (this works at least when the simulator app has paused on a breakpoint): po NSHomeDirectory() 要获取要分发的模拟器应用程序 ,可以在Xcode控制台中运行此命令(这至少在模拟器应用程序暂停断点时起作用): po NSHomeDirectory()

The folder will be something like: 该文件夹将类似于:

/Users/MyHomeFolder/Library/Developer/CoreSimulator/Devices/09BB353F-3AF9-4A2A-8CDB-0F15634AD6D8/data/Containers/Data/Application/8F509C84-6809-461D-9F9E-06811EF9A700 /用户/ MyHomeFolder /库/开发商/ CoreSimulator /设备/ 09BB353F-3AF9-4A2A-8CDB-0F15634AD6D8 /数据/容器/数据/应用/ 8F509C84-6809-461D-9F9E-06811EF9A700

The app bundle will be inside the Containers folder at Bundle/Application/3ADE9CF0-F6D0-4461-9B82-30A86580D2C7/StackOverflow.app 应用程序包将位于Bundle / Application / 3ADE9CF0-F6D0-4461-9B82-30A86580D2C7 / StackOverflow.app的Containers文件夹中。

Distribute the .app file, specifying the simulator device and iOS version used when compiling the bundle (the same has to be used by the receiver). 分发.app文件,指定编译软件包时使用的模拟器设备和iOS版本(接收方必须使用相同版本)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM