我想通過命令行運行我的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