How to run iOS Simulator in a specific language from the command line?

I need a lauch iOS simulator that uses a specific language using the command line. So I found that I can use

instruments -w <device> 

and it works fine, I can install a specific device. But how can I run a simulator with a specific language? I tried adding

 -AppleLanguages -AppleLocale 

but there are some warnings:

 Instruments Usage Error : Specified target process is invalid: -AppleLanguage 

thanks!

+3
source share
3 answers

The only way to run iOS Simulator with a specific language is to change the contents of your .GlobalPreferences.plist file. Using the xcrun tool xcrun not work, because it xcrun arguments to the running application and does not change the language of the simulator itself. Manipulating .GlobalPreferences.plist pretty complicated because it is a plist binary, so you cannot change it as a β€œnormal” xml . The easiest way to change its contents is to write a simple Xcode Command Line Tool application , the Foundation SDK has all the tools you need to modify the plists binary.

+2
source

The application launch should be installed and located (if not, the default language will open)

Use this command to launch an application using any language

 xcrun simctl launch <deviceid> <appid> -AppleLanguages "(pt-BR)" 

Example:

 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)" 
+4
source

Take a look:

https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/TestingYourInternationalApp/TestingYourInternationalApp.html Search "Testing specific languages ​​and regions"

Perhaps this may be a solution that creates different goals. Each goal has a different language.

0
source

All Articles