将 iOS 应用安装到 xcode 模拟器中?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4411390/
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
Install iOS app into xcode simulator?
提问by Matt Rogish
We're iOS (and other mobile platform) developers and our sales folks routinely need to provide demos of our apps for clients. What we're trying to do is automate a process so sales people can go to a self-serve website and feed the app into their simulator.
我们是 iOS(和其他移动平台)开发人员,我们的销售人员经常需要为客户提供我们的应用程序演示。我们正在尝试做的是自动化流程,以便销售人员可以访问自助网站并将应用程序输入到他们的模拟器中。
Using xcodebuild we can kick off the build process and then present it as a secure download link (via our intranet) but all that lets them do is install it to their iOS device. This is OK except not everyone on the road has an iOS device (or some have old iPod touches, and that's super slow). So, I was thinking that there's gotta be a way to get it installed in their simulator.
使用 xcodebuild,我们可以启动构建过程,然后将其作为安全下载链接(通过我们的内部网)呈现,但让他们做的就是将其安装到他们的 iOS 设备上。这没关系,除非路上的每个人都有 iOS 设备(或者有些人有旧的 iPod touch,而且速度非常慢)。所以,我在想必须有一种方法可以将它安装在他们的模拟器中。
I see that others have hacked it in there by zipping up a simulator directory and placing it on another: http://discussions.apple.com/thread.jspa?messageID=7680994
我看到其他人通过压缩模拟器目录并将其放在另一个目录中来破解它:http: //discussions.apple.com/thread.jspa?messageID=7680994
Set target to simulator, release. deploy. stop iphone simulator. zip your app from ~/Library/Application Support/iPhone Simulator/User/Applications/ send it to someone else, and let that person know to unzip it in that folder, than start iphone simulator - and you're done.
将目标设置为模拟器,发布。部署。停止iphone模拟器。从 ~/Library/Application Support/iPhone Simulator/User/Applications/ 压缩您的应用程序,将其发送给其他人,并让该人知道将其解压缩到该文件夹中,然后启动 iphone 模拟器 - 就完成了。
I guess we can do this, but it doesn't seem deterministic (or at least, a lot harder to script). I'd prefer to work with the .app but if the only way to do it is with this hacky copy and paste operation, that'll be what we have to do.
我想我们可以做到这一点,但它似乎不是确定性的(或者至少,编写脚本要困难得多)。我更喜欢使用 .app ,但如果唯一的方法是使用这种骇人听闻的复制和粘贴操作,那将是我们必须做的。
Any thoughts?
有什么想法吗?
回答by Mikael Lepist?
This could work: https://github.com/landonf/simlaunch/
这可以工作:https: //github.com/landonf/simlaunch/
I have not tried it yet by myself, but from video looks like the application converts .app compiled for simulator to a launcher, which can be used to run the app in simulator without installing it through xcode.
我自己还没有尝试过,但从视频看来,该应用程序会将为模拟器编译的 .app 转换为启动器,该启动器可用于在模拟器中运行该应用程序,而无需通过 xcode 安装它。
It probably uses the same kind of approach for simulating the app without installing it first that is described here: How to install iPhone application in iPhone Simulator
它可能使用相同类型的方法来模拟应用程序而不先安装它,如下所述:如何在 iPhone 模拟器中安装 iPhone 应用程序
回答by Nathan S.
I know this isn't a direct answer to your question, but have you thought about having a server (eg a Mac mini) that has all the installed software on it? Then they could just use some form of screen sharing to run the app remotely.
我知道这不是对您问题的直接回答,但是您是否考虑过拥有一台装有所有已安装软件的服务器(例如 Mac mini)?然后他们可以使用某种形式的屏幕共享来远程运行应用程序。
回答by nilsjesper
I've used the simulator build mechanism above with a number of clients and once they figure out the right folder to drop the actual folder into, it's gone very well.
我已经将上面的模拟器构建机制与许多客户端一起使用,一旦他们找到了将实际文件夹放入的正确文件夹,它就变得非常好。
It's a little bit of a hack as you say but in some cases it also beats having to deal with ad hoc provisioning etc when it's less important to have it on an actual device itself.
正如您所说,这有点像黑客攻击,但在某些情况下,当在实际设备上使用它不太重要时,它也胜过必须处理临时配置等。
I haven't tried it yet but I've heard pretty good things about Test Flight (http://testflightapp.com/) also as a way to distribute demos/betas so that might be worth a look as well.
我还没有尝试过,但我听说过关于试飞 (http://testflightapp.com/) 的一些很好的东西,也可以作为分发演示/测试版的一种方式,所以这也值得一看。
回答by Chris Prince
I just developed a pair of scripts to (a) extract an app from a iOS simulator, and (b) install it on another iOS simulator. https://github.com/christopher-prince/SimAppScripts
我刚刚开发了一对脚本来 (a) 从 iOS 模拟器中提取应用程序,以及 (b) 将其安装在另一个 iOS 模拟器上。https://github.com/christopher-prince/SimAppScripts
回答by russbishop
Locate the .app
bundle in your built products directory, typically under Debug-iphonesimulator
or Release-iphonesimulator
. Drag and drop that bundle onto the Simulator window and it will be installed (you may need to swipe on the home screen to show the icon).
.app
在您构建的产品目录中找到捆绑包,通常在Debug-iphonesimulator
或下Release-iphonesimulator
。将该包拖放到模拟器窗口,它将被安装(您可能需要在主屏幕上滑动以显示图标)。
You can also script this from the command line using xcrun simctl install
. The xcrun simctl launch
command can also start the application.
您还可以使用xcrun simctl install
. 该xcrun simctl launch
命令还可以启动应用程序。
Most build systems can be automated (or you can use a post-build script from within Xcode, ordered as the last step) to create a ZIP of the app bundle and put it somewhere for download.
大多数构建系统都可以自动化(或者您可以使用 Xcode 中的构建后脚本,作为最后一步订购)来创建应用程序包的 ZIP 并将其放在某处以供下载。
(If having the Archive workflow support creating Simulator IPAs would be useful for you please file an enhancement request at https://bugreport.apple.com)
(如果存档工作流支持创建模拟器 IPA 对您有用,请在https://bugreport.apple.com提交增强请求)
回答by jwallis
check out waxsim:
查看waxsim:
https://github.com/square/WaxSim
https://github.com/square/WaxSim
If you build it for i386 and distribute the .app, I believe this will work.
如果您为 i386 构建它并分发 .app,我相信这会奏效。