15

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!

MichalMoskala
  • 887
  • 1
  • 12
  • 25
  • It's probably set via env variable. Run `xcodebuild -workspace -target -configuration -showBuildSettings` and grep for *-AppleLanguages*. Do you get any reasonable output? – Opal Jul 15 '15 at 06:15
  • Did you ever find a solution? – Just a coder Sep 20 '17 at 22:58

1 Answers1

1

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)"
Haroldo Gondim
  • 7,725
  • 9
  • 43
  • 62