ios - Xcodebuild 以不同的语言运行应用程序单元测试
<p><p>这里描述了应该可以使用 xcodebuild 命令覆盖用户默认设置。 </p>
<p>我还需要使用这种机制将语言设置为特定的语言来执行我的单元测试。任何想法如何做到这一点?当我通过 '-AppleLanguages="(en)"' 时,xcodebuild 命令总是无法启动模拟器,但出现异常:</p>
<pre><code>2015-09-08 13:07:13.178 xcodebuild -: unrecognized selector sent to instance 0x2945442d65642875
** INTERNAL ERROR: Uncaught exception **
Exception: -: unrecognized selector sent to instance 0x2945442d65642875
Stack:
00x00007fff8edfe024 __exceptionPreprocess (in CoreFoundation)
10x00007fff97d8776e objc_exception_throw (in libobjc.A.dylib)
20x00007fff8ee010ad - (in CoreFoundation)
30x00007fff8ed46e24 ___forwarding___ (in CoreFoundation)
40x00007fff8ed46998 _CF_forwarding_prep_0 (in CoreFoundation)
50x00007fff982941f2 __CopyAppleLanguages_block_invoke (in Metadata)
60x00007fff98331c13 _dispatch_client_callout (in libdispatch.dylib)
70x00007fff98331b26 dispatch_once_f (in libdispatch.dylib)
80x00007fff982941a8 CopyAppleLanguages (in Metadata)
90x00007fff98293f0e _MDAccessCopyClientPort (in Metadata)
100x00007fff9829befe ___MDQueryMakeClientPortLocked_block_invoke (in Metadata)
110x00007fff98336323 _dispatch_call_block_and_release (in libdispatch.dylib)
120x00007fff98331c13 _dispatch_client_callout (in libdispatch.dylib)
130x00007fff9833488f _dispatch_root_queue_drain (in libdispatch.dylib)
140x00007fff98342fe4 _dispatch_worker_thread3 (in libdispatch.dylib)
150x00007fff9a6bca9d _pthread_wqthread (in libsystem_pthread.dylib)
160x00007fff9a6ba3dd start_wqthread (in libsystem_pthread.dylib)
82720 abort xcodebuild -workspace APP.xcworkspace -scheme APP_DEBUG -sdktest
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p><code>man xcodebuild</code> 揭示了两个选项:<code>-testLanguage</code> 和 <code>-testRegion</code> 遵循 ISO 639-1 和 ISO 3166-1标准</p></p>
<p style="font-size: 20px;">关于ios - Xcodebuild 以不同的语言运行应用程序单元测试,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/32476036/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/32476036/
</a>
</p>
页:
[1]