繁体   English   中英

使用Calabash-ios将cmd线参数传递给应用

[英]Pass cmd line args to app with Calabash-ios

我正在使用calabash-ios进行测试自动化,并且在启动时将命令行参数传递给我的iOS应用程序很挣扎。 我不是Ruby程序员,但查看源代码会提示我尝试将cmd行args附加到APP路径。 我在calabash-ios控制台中尝试了以下操作:

start_test_server_in_background({:app => "#{ENV['APP']} -OverrideWebApp test/index.html"})

其中“ -OverrideWebApp test / index.html”是我要通过的cmd行参数。 我应该使用一些特殊的键或挂钩来将cmd行参数传递给我的应用程序吗?

要将参数传递给应用程序,请使用:

 options = {:args => ['-com.apple.CoreData.ConcurrencyDebug', '1']}
 start_test_server_in_background(options)

有关更多详细信息,请参见: https : //github.com/calabash/calabash-ios/issues/363

要点是传递逗号分隔的字符串列表。 在您的情况下:

 options = {:args => ["-OverrideWebApp", "test/index.html"]}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM