【问题标题】:What are the accepted values for the mtouch --device=VALUE option?mtouch --device=VALUE 选项的可接受值是什么?
【发布时间】:2012-02-07 08:45:33
【问题描述】:

我正在尝试从终端在 iPad 模拟器上安装和启动已编译的 MonoTouch 应用程序。现在,我正在使用

mtouch --sdk=5.0 --launchsim=MyApp.app

应用程序启动,但无论模拟器的当前状态如何,它总是在 iPhone 模拟器上启动应用程序,而不是在 iPad 模拟器上启动应用程序,尽管相关应用程序仅针对 iPad 设置。 mtouch 的用法表明我可以将值传递给 --device=VALUE 选项以指定要使用的设备类型,但不管我把它作为 iPhone 模拟器启动。

我的问题是,这个选项的可接受值是什么? something 确实有效,因为 MonoDevelop 在正确的模拟器中启动应用程序没有问题。

【问题讨论】:

    标签: ios ipad xamarin.ios ios-simulator command-line-interface


    【解决方案1】:

    格式如下(用值替换____):

    --device=":v2:runtime=____,devicetype=____"
    

    要获得可用的运行时运行:

    xcrun simctl list runtimes
    

    要获得可用的设备类型运行:

    xcrun simctl list devicetypes
    

    例子:

    --device=":v2:runtime=com.apple.CoreSimulator.SimRuntime.iOS-11-0,devicetype=com.apple.CoreSimulator.SimDeviceType.iPhone-6"
    

    来源:https://github.com/xamarin/xamarin-macios/blob/3d429a106ba96f10d964fb39a0fa5d93581dceef/tests/mtouch/MLaunchTool.cs

    【讨论】:

      【解决方案2】:

      您正在寻找的是:

      /Developer/MonoTouch/usr/bin/mtouch --launchsim=MyApp.app --device=2
      

      这与正在使用的底层 API 的值相同。话虽如此,它并不是真的有用。我将考虑添加有关此的文档(--help)以及对某些字符串值的支持。

      【讨论】:

      • 谢谢!像魅力一样工作。
      猜你喜欢
      • 2012-03-20
      • 2019-06-07
      • 2011-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-05
      • 2019-12-14
      相关资源
      最近更新 更多