Terminal Xcode 6-如何从终端在IOS模拟器Mobile Safari中打开Url?

Terminal Xcode 6-如何从终端在IOS模拟器Mobile Safari中打开Url?,terminal,ios-simulator,mobile-safari,xcode6,Terminal,Ios Simulator,Mobile Safari,Xcode6,我最近更新到Xcode 6,但现在之前的版本不起作用: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication /Applications/Xcode.app/Contents/Developer/Pl

我最近更新到Xcode 6,但现在之前的版本不起作用:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/Applications/MobileSafari.app/MobileSafari -u "http://google.com/"
我做了大量的前端工作和响应性设计,每天必须在每个浏览器中多次查看结果。没有这个命令是非常痛苦的

另外,我想用一个命令在IOS7中打开,用另一个命令在IOS8中打开。

xcrun-simctl-openurlhttp://www.google.com
xcrun simctl openurl <Device UDID> http://www.google.com
您可以通过运行
xcrun simctl list
来确定设备UDID,或者在较新版本上,您可以使用“booted”而不是UDID来引用当前引导的设备

请注意,这要求iOS模拟器实际运行。根据您拥有的Xcode.app版本,您可能可以使用“引导”别名而不是设备UDID来选择当前引导的设备


您可能还想查看有关如何启动iOS模拟器应用程序并让其启动特定设备的信息。

谢谢。我不知道为什么,但是StackOverflow没有通知我有答案。我今天就试试,然后回应。再次感谢。另外,您可以添加此命令实际执行的操作的描述吗?这些命令对我来说是完全陌生的。@stoutie运行“xcrun simctl help”以获取有关simctl命令的其他帮助。xcrun命令是从当前选定的Xcode.app中执行simctl的包装器。我无法让它工作。我不确定列表中的设备id是什么?您只需传递标志:booted即可使用当前模拟器,因此您必须查找它的UDID。示例:
xcrun-simctl-openurl已启动http://www.google.com