Here was described that it should be possible to overwrite user defaults settings using the xcodebuild command.
I also need to use this mechanism to set the language to a specific one for executing my unit tests. Any Idea how to accomplish this? The xcodebuild command always fails launching the simulator when I pass '-AppleLanguages="(en)"' with an exception:
2015-09-08 13:07:13.178 xcodebuild[82720:7171617] -[NSTaggedPointerString count]: unrecognized selector sent to instance 0x2945442d65642875
** INTERNAL ERROR: Uncaught exception **
Exception: -[NSTaggedPointerString count]: unrecognized selector sent to instance 0x2945442d65642875
Stack:
0 0x00007fff8edfe024 __exceptionPreprocess (in CoreFoundation)
1 0x00007fff97d8776e objc_exception_throw (in libobjc.A.dylib)
2 0x00007fff8ee010ad -[NSObject(NSObject) doesNotRecognizeSelector:] (in CoreFoundation)
3 0x00007fff8ed46e24 ___forwarding___ (in CoreFoundation)
4 0x00007fff8ed46998 _CF_forwarding_prep_0 (in CoreFoundation)
5 0x00007fff982941f2 __CopyAppleLanguages_block_invoke (in Metadata)
6 0x00007fff98331c13 _dispatch_client_callout (in libdispatch.dylib)
7 0x00007fff98331b26 dispatch_once_f (in libdispatch.dylib)
8 0x00007fff982941a8 CopyAppleLanguages (in Metadata)
9 0x00007fff98293f0e _MDAccessCopyClientPort (in Metadata)
10 0x00007fff9829befe ___MDQueryMakeClientPortLocked_block_invoke (in Metadata)
11 0x00007fff98336323 _dispatch_call_block_and_release (in libdispatch.dylib)
12 0x00007fff98331c13 _dispatch_client_callout (in libdispatch.dylib)
13 0x00007fff9833488f _dispatch_root_queue_drain (in libdispatch.dylib)
14 0x00007fff98342fe4 _dispatch_worker_thread3 (in libdispatch.dylib)
15 0x00007fff9a6bca9d _pthread_wqthread (in libsystem_pthread.dylib)
16 0x00007fff9a6ba3dd start_wqthread (in libsystem_pthread.dylib)
[1] 82720 abort xcodebuild -workspace APP.xcworkspace -scheme APP_DEBUG -sdk test
man xcodebuild
reveals two options for doing that : -testLanguage
and -testRegion
which follows the ISO 639-1 and ISO 3166-1 standards