Xcode 我可以启动iPhone模拟器而不使用;“构建并运行”吗;?
我想在“构建并运行”之前删除模拟器中的应用程序。如何启动模拟器以便执行删除操作?如果我从“构建并运行”开始,我会得到一个很长的日志输出,这需要一段时间,因为我正试图修复一个bug。我希望避免这种情况。模拟器只是一个应用程序,因此您可以像运行其他任何应用程序一样运行它 要直接从终端运行模拟器,请使用Xcode 我可以启动iPhone模拟器而不使用;“构建并运行”吗;?,xcode,ios-simulator,Xcode,Ios Simulator,我想在“构建并运行”之前删除模拟器中的应用程序。如何启动模拟器以便执行删除操作?如果我从“构建并运行”开始,我会得到一个很长的日志输出,这需要一段时间,因为我正试图修复一个bug。我希望避免这种情况。模拟器只是一个应用程序,因此您可以像运行其他任何应用程序一样运行它 要直接从终端运行模拟器,请使用open命令预先设置这些位置 Xcode 7.x、8.x和9.x 在Xcode 7.x中,iPhone模拟器再次移动:/Applications/Xcode.app/Contents/Developer
open
命令预先设置这些位置
Xcode 7.x、8.x和9.x
在Xcode 7.x中,iPhone模拟器再次移动:/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
Xcode 6.x
在Xcode 6.x中,iPhone模拟器再次移动,现在驻留在这里:/Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app
Xcode 4.x、5.x 在Xcode 4.x(在Mountain Lion上通过4.5)和Xcode 5.0.x(在Mavericks上)中,它生活在这里:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/
在我的Xcode版本(4.5.2)中,我发现从dock图标或Xcode菜单使用Open Developer Tool
菜单非常方便:
Xcode 3.x 在Xcode 3.x中,它位于以下位置:
/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhoneSimulator.app
在未来的Xcode版本中,它可能会再次移动,这是一个非常小的应用程序 首先,将iOS模拟器添加到应用程序:
ln -s /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app /Applications/iPhone\ Simulator.app
从那里你可以在Finder中打开它或将它拖到启动栏
来源:由于XCode 4.3位置已更改,现在可以在以下位置找到模拟器: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/
接下来,@jimbojw使用新Xcode(通过首选项安装)创建快捷方式的新命令是:
这将在应用程序文件夹中为您创建一个快捷方式。这是一个较老的问题,但如果您只是想从Xcode 4.5 UI运行模拟器,您可以执行以下操作:Xcode>Open Developer Tool>iOS模拟器。从终端可以使用:
open -a iPhone\ Simulator
open -a iOS\ Simulator
open -a Simulator
这一切都取决于模拟器的应用程序名称,这可能会随着Xcode的每次迭代而改变。最简单的方法是从
Xcode
启动模拟器,然后在dock上,Ctrl
+单击图标上的并选择保持在dock
而不打开Xcode:
open /Applications/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app/
使用聚光灯
但只有最后一个模拟器将被打开。如果您上次使用了iPad Air 2,Spotlight将打开它。如果你这次想打开iphone6s,那是个问题
对于Xcode 7.2
打开/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator.app
sudo/模拟器
在您的个人资料中添加此路径是最好的方法。@jimbojw-它是一个应用程序包,所以是的,它也是一个文件夹。如果双击它(或使用open
terminal命令),它将运行。顺便说一句,它被称为“iOS模拟器.app”更新的iPhone SDK。谢谢-缺少的部分是打开的
。我在/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\Simulator.app中找到的完整路径是/Applications/Xcode.app
,请注意,如果您在Finder中选择上面的注释中的路径,你可以像其他应用一样将模拟器拖到你的基座上。我在“/Applications/Xcode.app/Contents/Applications/iOS simulator.app”找到了它。要更改设备,请在模拟器应用程序中,单击硬件>设备。右键单击Dock中的Xcode也可以访问Open Developer Tool菜单@乔瑞克,我很清楚你的感受!我在微软微软的Windows平台上工作了10年!为此,我在~/.bash_配置文件中添加了一个别名:alias ios=“open/Applications/Xcode.app/Contents/Developer/Applications/ios\Simulator.app”
,这样我就可以从命令行运行ios
,在我的机器上,应用程序只是Simulator.app
而不是iOS Simulator.app
。这是迄今为止最简单的解决方案。如果不起作用,请尝试使用iOS\Simulator
。您可以通过导航到文件->打开模拟器菜单来选择不同的设备。
open /Applications/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app/