1.使用xcodebuild命令編譯工程時(shí)理盆,提示某些第三方庫(kù)文件not found
錯(cuò)誤日志
xcodebuild -target Guide -configuration Release
描述:這個(gè)問題很奇怪结序,只要編譯成功過一次,上述命令就可以通過!
編譯通過的方法如下:
- Converted build to use an Xcode workspace & scheme (instead of project & target)
- Rearranged workspace to have the App project and static library as siblings (not as parent/child)
- Changed Xcode and workspace settings to use build locations specified in targets
- Change Build Products Path for App and Library to use ../build (both project files are contained in sibling subfolders of a master directory, so having them build into the same folder solved the original linker/Ld command problem, I think)
- Edited the App scheme to explicitly build the Library target, and build it before the App target
- In the Build Phases for the App target, explicitly add the Library under "Link Binary With Libraries"
- Change the location type of the Library's .a file reference to "Relative to Build Products"
- Added a "Copy Headers" build phase to the Library project, added the appropriate headers to the Public section
- Changed the Public Headers Folder Path of the Library project to "/include"
- Changed the Installation Directory of the Library to $(BUILT_PRODUCTS_DIR)
- Changed the Library Search Paths and the User Header Search Paths of the App target to $(BUILT_PRODUCTS_DIR)
(recursive) - Added a Clean command before the build on my Jenkins build server
- Added explicit SDK and Arch arguments to the build command
- Removed spaces from build configuration name
最終的命令形式:
xcodebuild -workspace ClientName.xcworkspace -scheme AppName -configuration "ProdAdHoc" -sdk iphoneos -arch "armv6 armv7"
參考鏈接:
[http://stackoverflow.com/questions/6653188/xcode-4-build-succeeds-command-line-build-fails?rq=1]