指定源 Source
source 'https://github.com/aliyun/aliyun-specs.git'
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
本地引用
pod 'MyModule', :path => '/Users/daliu/Documents/Modules/MyModule'
基于遠(yuǎn)程分支引用
pod 'MyModule', :git => 'http://.../MyModule.git', :branch => 'dev'
基于某一次提交引用
pod 'DLTest', :git => 'git@gitlab.daliu.net:rjhy/app/base/ios/DLTest.git', :commit => '22ea695e1335caae2a8a2cbf2667a79bf81228aa'
跳過 pod repo update
pod update --no-repo-update
版本指定
配置只在測(cè)試環(huán)境使用
pod 'AMLeaksFinder', :configurations => ['DEBUG']
適配Xcode 14 真機(jī)pod工程中bundle target簽名報(bào)錯(cuò)
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CODE_SIGN_IDENTITY'] = ''
end
end
end
end
執(zhí)行podlint報(bào)錯(cuò)
執(zhí)行pod spec lint的時(shí)候報(bào)了一個(gè)錯(cuò)誤
ld: in /var/folders/.../Pods/YYKit/Vendor/WebP.framework/WebP(anim_decode.o), building for iOS Simulator, but linking in object file built for iOS, file '/var/folders/w8/.../Pods/YYKit/Vendor/WebP.framework/WebP' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
問題分析:YYKit/WebP.framework中沒有arm64
解決方法:在podspec指定模擬器排除arm64架構(gòu)
s.pod_target_xcconfig = {
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
}
s.user_target_xcconfig = {
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
}