gpt4 book ai didi

ios - Xcodebuild 以不同语言运行应用程序单元测试

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:12:43 26 4
gpt4 key购买 nike

这里描述了应该可以使用 xcodebuild 命令覆盖用户默认设置。

我还需要使用此机制将语言设置为特定语言以执行我的单元测试。知道如何做到这一点吗?当我传递 '-AppleLanguages="(en)"' 时,xcodebuild 命令总是无法启动模拟器,但出现异常:

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 揭示了两个选项:-testLanguage-testRegion,它们遵循 ISO 639-1 和 ISO 3166-1标准

关于ios - Xcodebuild 以不同语言运行应用程序单元测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32476036/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com