带有参数的 xcode 命令行测试在启动时传递

xcode command line test with argument passed at launch(带有参数的 xcode 命令行测试在启动时传递)
本文介绍了带有参数的 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 命令行测试在启动时传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)