我想通过命令行运行我的Xcode单元测试,所以我最终可以将它连接到Jenkins的CI。工作区包含2个项目:错误从命令行运行Xcode单元测试
CommonProject(用于多个应用共享库)
MainProject
的MainProject使用库在CommonProject,所以有扶养。每个项目都有自己独立的xcodeproj文件。
所以我需要运行与MainProject关联的单元测试。我使用此命令从主项目目录中的终端运行单元测试:
xcodebuild test -scheme MainProject -configuration Debug -sdk iphonesimulator7.0 -destination OS=7.0,name="iPad"
我收到以下错误。
ld: warning: directory not found for option '-L/development/MainProject/../../../../Library/Developer/Xcode/DerivedData/MainProject-frbbgalqmolpaxcdmzssejnssluu/Build/Products/Debug-iphoneos'
ld: warning: directory not found for option '-F/development/MainProject/../../../../Library/Developer/Xcode/DerivedData/DTCoreText-fgbvjplplkeyyghcvrfbmvoetoiq/Build/Products/Debug-iphoneos'
ld: library not found for -lCommonProject
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** TEST FAILED **
The following build commands failed:
Ld /Library/Developer/Xcode/DerivedData/MainProject-bxpugeyjdgrcfcgxxpttwlgmfrma/Build/Products/Debug-iphonesimulator/MainProject.app/MainProject normal i386
由于单元测试需要的常见项目来运行,也未必能找到它需要,因为它们都位于一个单独的目录中的文件。有没有人有过这个问题之前或有任何想法,我可以解决它?
这工作!我唯一需要做的事情是使用首选项 - >位置,高级将构建位置设置为共享文件夹。我用那个位置作为configuration_build_dir。谢谢。 – tomg101