【发布时间】:2015-12-14 12:26:48
【问题描述】:
我正在使用xctest 在命令行上运行 iOS 模拟器单元测试。首先我构建目标:
xcodebuild -project "build/MyApp.xcodeproj" -target "MyApp Unit Tests" -configuration "Debug" -sdk "iphonesimulator" build
然后在测试包上运行xctest:
xcrun xctest "build/build/Debug-iphonesimulator/MyApp Unit Tests.xctest"
这很好用,并且可以链接 /System/Library/Frameworks 中的框架,例如 Security。但是xctest 在我添加像 MobileCoreServices 这样的 iOS SDK 框架后立即中断,给我:
Library not loaded: /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
单元测试在 Xcode 中运行良好,单元测试目标在其框架搜索路径中包含 $(PLATFORM_DIR)/Developer/Library/Frameworks。
有人知道让xctest 找到iOS 框架的正确方法吗?
【问题讨论】:
标签: ios xcode unit-testing xctest xcrun