我想在“构建和运行”之前删除模拟器中的应用程序。如何启动模拟器以便删除?如果我通过“构建并运行”启动它,我得到一个长的日志输出,需要一段时间,因为我正在尝试修复的错误。我想避免这种情况。
答案 0 :(得分:226)
模拟器只是一个应用程序,因此您可以像任何其他应用程序一样运行它。
直接从终端运行模拟器,使用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)和Mavericks上的Xcode 5.0.x中,它存在于:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/
在我的Xcode版本(4.5.2)中,我发现使用停靠图标或Xcode菜单中的Open Developer Tool
菜单非常方便:
Xcode 3.x
在Xcode 3.x中,它住在这里:
/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app
在Xcode的某个未来版本中,它可能会再次移动,它是一个可靠的小应用程序。
答案 1 :(得分:34)
由于XCode 4.3的位置已经改变,现在可以在以下位置找到模拟器:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications /
答案 2 :(得分:31)
从终端您可以使用:
open -a iPhone\ Simulator
open -a iOS\ Simulator
open -a Simulator
这一切都取决于模拟器的应用程序名称,这可能会随着Xcode的每次迭代而改变。
答案 3 :(得分:24)
要跟进来自@jimbojw的新命令,用新Xcode创建快捷方式(通过首选项安装)是:
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app /Applications/iPhone\ Simulator.app
这将为您在应用程序文件夹中创建一个快捷方式。
答案 4 :(得分:7)
首先,将iOS模拟器添加到应用程序:
ln -s /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app /Applications/iPhone\ Simulator.app
从那里你可以在Finder中打开它或将它拖到启动栏。
来源:http://www.bram.us/2010/05/05/xcode-iphone-simulator-location/
答案 5 :(得分:6)
这是一个较旧的问题,但如果你只是想从Xcode 4.5 UI运行模拟器,你可以这样做:Xcode>打开开发人员工具> iOS模拟器。
答案 6 :(得分:4)
答案 7 :(得分:3)
最简单的方法是从Xcode
启动模拟器,然后在停靠栏上Ctrl
+ Click
启动模拟器,然后选择Keep in Dock
答案 8 :(得分:3)
不打开Xcode:
open /Applications/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app/
答案 9 :(得分:2)
对于Xcode 7.2
打开/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator.app
sudo ./Simulator
在您的个人资料中添加此路径是最佳方式。