【问题标题】:Is there a way to start MobileSafari.app in the iPhone Simulator with a url有没有办法在 iPhone 模拟器中使用 url 启动 MobileSafari.app
【发布时间】:2012-12-02 08:13:11
【问题描述】:

我们想在尽可能多的浏览器中测试我们的网站,在我们的持续集成服务器中,在 ios 中也是如此。我们想通过打开 safari 的 url 来启动 ios 模拟器。我们可以这样开始 safari:

/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/iPhoneSimulator6.0.sdk/Applications/MobileSafari.app/MobileSafari

但我们还没有弄清楚如何将 url 作为参数。

【问题讨论】:

    标签: ios-simulator mobile-safari


    【解决方案1】:

    试试 -u:

    /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/iPhoneSimulator6.0.sdk/Applications/MobileSafari.app/MobileSafari -u http://www.google.com

    【讨论】:

    • 它启动了 safari 应用程序但没有打开 url。
    • 奇怪。这个对我有用。确保 Safari 尚未启动。
    • 尝试重新开始和现有的 safari 运行 - 没有差异 ;(
    • 对我也不起作用(我在用 iPhoneSimulator6.0.sdk 在这里询问之前尝试过 -u,现在我在 iPhoneSimulator6.1.sdk 上,但它不起作用这个版本也是)。例如,如果我用一个打开的 safari 运行 google 来关闭模拟器,它肯定会从下次打开 google 开始,也许你尝试过这种方式?
    • -u 在浏览器中打开 URL,MobileSafari 的路径是一条红鲱鱼。这同样有效:/path/to/simulator -u http://www.google.com
    【解决方案2】:

    它适用于 Jan 命令,但您必须更正 SDK“iPhoneSimulator6.0.sdk”的路径。 我将命令运行到 iOS 7 SDK 并且每次我想打开的页面都打开了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-28
      • 1970-01-01
      • 2012-04-19
      • 1970-01-01
      • 2012-03-21
      • 1970-01-01
      • 2011-02-02
      相关资源
      最近更新 更多