我使用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。但是,一旦我添加了一个像MobileCoreServices这样的iOS开发工具包框架,xctest就崩溃了,它给了我:
Library not loaded: /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices单元测试在Xcode中运行良好,并且单元测试目标在其框架搜索路径中包含$(PLATFORM_DIR)/Developer/Library/Frameworks。
有人知道让xctest找到iOS框架的正确方法吗?
发布于 2015-10-21 01:55:55
测试目标需要能够在构建的MyApp产品中查找框架。您应该将框架搜索路径添加到测试目标:
$(CONFIGURATION_TEMP_DIR)/MyApp.build/DerivedSourceshttps://stackoverflow.com/questions/32633647
复制相似问题