XCTest不链接iOS框架
我正在使用xctest
在命令行上运行iOS模拟器unit testing。 首先,我构建目标:
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 SDK框架, xctest
就会中断,这给了我:
Library not loaded: /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
unit testing在Xcode中运行良好,unit testing目标在其框架搜索路径中包含$(PLATFORM_DIR)/Developer/Library/Frameworks
。
有人知道让xctest
找到iOS框架的正确方法吗?
测试目标需要能够在MyApp的构建产品中查找框架。 您应该向测试目标添加框架搜索路径:
$(CONFIGURATION_TEMP_DIR)/MyApp.build/DerivedSources
- UICollectionView insertItemsAtIndexPaths:抛出exception
- 以编程方式查找应用程序的URL
- 带有AVAudioPlayer的SKEmiterNode用于音乐视觉效果
- 试图添加一个UIButton到一个UIView但得到NSInvalidArgumentException',原因:' – :无法识别
- 什么是iOS的等同于Android的Socket编程代码?
- 资源子目录中的iOS自定义字体
- IOS SWIFT:声明仅在文件范围内有效
- animationControllerForPresentedController和animateTransition之间的自定义过渡animation未知延迟
- “CGPointMake”在swift中不可用