我设法让静态库正常工作,一切都很好。现在我已经转移到了我想要创建的合适的库,我遇到了问题。我使用 cocoapods 导入其他文件并创建一个工作区。现在我用于编译的脚本不再有效,我的假设是因为我现在正在一个框架中工作。我已经在谷歌上搜索了几个小时试图得到答案,但我发现的所有事情都只与将单个项目变成一个库有关我的问题是:1)是否可以将一个工作区合并到一个库中?2)我应该尝试创建一个框架吗?3)只是我的脚本不对吗?
XCODEBUILD_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin
XCODEBUILD=$XCODEBUILD_PATH/xcodebuild
$XCODEBUILD -project T5Pusher.xcodeproj -target "T5Pusher" -sdk "iphoneos" - configuration "Release" clean build
$XCODEBUILD -project T5Pusher.xcodeproj -target "T5Pusher" -sdk "iphonesimulator" - configuration "Release" clean build
lipo -create -output "build/libT5Pusher.a" "build/Release-iphoneos/libT5Pusher.a" "build/Release-iphonesimulator/libT5Pusher.a"
也试过这个
XCODEBUILD_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin
XCODEBUILD=$XCODEBUILD_PATH/xcodebuild
$XCODEBUILD -workspace T5Pusher.xcworkspace -scheme "T5Pusher" -sdk "iphoneos" - configuration "Release" clean build
$XCODEBUILD -workspace T5Pusher.xcworkspace -scheme "T5Pusher" -sdk "iphonesimulator" - configuration "Release" clean build
lipo -create -output "build/libT5Pusher.a" "build/Release-iphoneos/libT5Pusher.a" "build/Release-iphonesimulator/libT5Pusher.a"
我得到的错误是
** BUILD FAILED **
The following build commands failed:
Libtool build/PusherTest.build/Release-iphoneos/PusherTest.build/Objects- normal/armv7/libPusherTest.a normal armv7
Libtool build/PusherTest.build/Release-iphoneos/PusherTest.build/Objects-normal/armv7s/libPusherTest.a normal armv7s
(2 failures)
lipo: can't open input file: build/Release-iphoneos/libPusherTest.a (No such file or directory)
Showing first 200 notices only
第二,构建成功,但从未创建库(.a)文件,因此无法组合它们