xcode command line test with argument passed at la

2019-03-24 21:12发布

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?

My script looks like this

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

Thanks!

1条回答
ゆ 、 Hurt°
2楼-- · 2019-03-24 21:41

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)"
查看更多
登录 后发表回答