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

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

问题描述

我在 CI 实施 xcodebuild 命令测试时遇到了小问题.我有与特定设备语言相关的测试,在 xcode 中我可以将启动时传递的参数"设置为 -AppleLanguages(语言).我可以使用 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 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天全站免登陆