I need to lauch iOS Simulator that uses specific language using command line. So I found that I can use
instruments -w
and i
To run your app must be installed and located (if not, will open default language)
Use this command to run your app with some language
xcrun simctl launch <deviceid> <appid> -AppleLanguages "(pt-BR)"
Sample:
xcodebuild -sdk iphonesimulator8.4 -arch i386 install DSTROOT=SomeFolder
xcrun instruments -w "iPhone 6 (8.4 Simulator)"
xcrun simctl install booted SomeFolder/Applications/YourApp.app
xcrun simctl launch booted com.yourdomain.yourapp -AppleLanguages "(pt-BR)"
Have a look at:
https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/TestingYourInternationalApp/TestingYourInternationalApp.html Search for "Testing Specific Languages and Regions"
Perhaps it could also be a solution creating different targets. Each target has configured another language
The only way to launch iOS Simulator
with specific language is to change contents of its .GlobalPreferences.plist
file. Using xcrun
tool will not work because it passess arguments to launched app and not changing language of simulator itself. Manipulation on .GlobalPreferences.plist
is quite difficult because it is a binary plist
file, so you cannot modify it as 'normal' xml
. The easiest way to change its contents is to write simple Xcode Command Line Tool application
, Foundation SDK
has all tools needed to modify binary plists
.