如何在不使用XCode重建应用程序的情况下在模拟器中启动iOS应用程序 [英] How to launch an iOS app in the simulator without XCode rebuilding the app

查看:85
本文介绍了如何在不使用XCode重建应用程序的情况下在模拟器中启动iOS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我已经使用Xcode为模拟器构建了iOS应用程序,那么有什么方法可以在模拟器中手动启动它并/或将其从build-dir复制到模拟器中? 原因是如果我更改任何代码,我不希望XCode决定在模拟器中运行时将重建所有内容,因为这需要几分钟.

If I've build an iOS app for the simulator using Xcode, is there a way I can manually launch this in the simulator and/or copy it from the build-dir onto the simulator? The reason being if I change any of my code, I don't want XCode to decide it's going to rebuild everything when I run in the simulator, as this takes several minutes.

我看到模拟器目录使用某种GUID命名,并具有一些额外的子目录.对此有什么魔力,还是我可以创建一个新目录并将其应用程序转储到其中?

I see simulator dirs are named using some sort of GUID and have some extra sub-dirs. Is there any magic to this or can I create a new dir and dump my app into it?

推荐答案

首先,确定构建目录所在的位置.通常,它将位于项目目录的根目录中,如下所示:

First, determine where your build directory is located. This will normally be inside the root of your project directory, like this:

${PROJECT}/build

然后找到您构建的哪个构建目标,它将是Debug还是Release,并且应该用于iPhone Simulator.通常可以在构建目录中找到以下内容之一:

Then locate which build target you built, which will be either Debug or Release, and it should be for the iPhone Simulator. This is normally found in the build directory as one of the following:

${PROJECT}/build/Debug-iphonesimulator 

OR

${PROJECT}/build/Release-iphonesimulator

现在找到您的应用程序捆绑包,其中将包含可以加载到iOS Simulator中的实际应用程序.这将位于上面的目录之一下面,如:

Now locate your application bundle, which will contain the actual app which can be loaded into the iOS Simulator. This will be underneath one of the directories above, as in:

${PROJECT}/build/Debug-iphonesimulator/<yourapp>.app

正如我所说的,这是一个应用程序捆绑包,因此它实际上是一个目录,在此目录中,您会找到应用程序的可执行文件:

As I say this is an application bundle, so it's actually a directory, and inside this directory you will find the executable for your app:

${PROJECT}/build/Debug-iphonesimulator/<yourapp>.app/<yourapp>

您现在可以使用以下命令在iOS模拟器中启动您的应用程序:

you can now launch your app in the iOS Simulator with:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication ${PROJECT}/build/Debug-iphonesimulator/<yourapp>.app/<yourapp>

这篇关于如何在不使用XCode重建应用程序的情况下在模拟器中启动iOS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆