xcode命令行测试,启动时传递参数 [英] xcode command line test with argument passed at launch

查看:1501
本文介绍了xcode命令行测试,启动时传递参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在CI上实现xcodebuild命令测试有小问题。我有与特定设备语言相关的测试,在xcode中我可以设置Arguments Passed On Launch到-AppleLanguages(language)。我可以使用xcodebuild传递参数?

I have small problem with implementing xcodebuild command test at CI. I have tests related to specific device language, in xcode I can set "Arguments Passed On Launch" to -AppleLanguages (language). Can I pass that argument using xcodebuild?

我的脚本看起来像这样

xcodebuild -workspace MyApp.xcworkspace -scheme "MyAppTests" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.0' test

谢谢!

推荐答案

xcodebuild 是用于构建您的应用程序。您可以使用此命令以特定语言运行应用程序。

xcodebuild is for build your app. You can use this command to run your app with specific language.

xcrun simctl launch <deviceid> <appid> -AppleLanguages "(pt-BR)"

Hera一个包含所有步骤的示例,

Hera a sample with all steps to buil and run your app:

xcodebuild -sdk iphonesimulator8.4 -arch i386 install DSTROOT=YourAppFolder
xcrun instruments -w "iPhone 6 (8.4 Simulator)"
xcrun simctl install booted YourAppFolder/Applications/YourApp.app
xcrun simctl launch booted com.yourdomain.yourapp -AppleLanguages "(pt-BR)"

这篇关于xcode命令行测试,启动时传递参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆