Carthage使用工作记录


Carthage使用工作记录

========================
主要是三点

1、写Cartfile

github "SnapKit/SnapKit"                    ~> 5.0
...

2、工程目录下命令行

生成framework

carthage update --platform iOS

生成xcframework

carthage update --platform iOS --use-xcframeworks

多平台

carthage update --use-xcframeworks

3、拖入工程

在工程目录下会生成一个Carthage文件,里面有个Build文件,其中可以找到生成的库

记录

zhangsaidong@zhangsaidongs-MacBook-Pro InterfaceKit % cd /Users/zhangsaidong/Desktop/test
zhangsaidong@zhangsaidongs-MacBook-Pro test % $ carthage update --platform iOS
zsh: command not found: $
zhangsaidong@zhangsaidongs-MacBook-Pro test % carthage update --platform iOS 
*** Fetching SnapKit
*** Checking out SnapKit at "5.0.1"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.LDPWAL.log
*** Building scheme "SnapKit" in SnapKit.xcworkspace
A shell task (/usr/bin/xcrun lipo -create /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/SnapKit/5.0.1/Build/Intermediates.noindex/ArchiveIntermediates/SnapKit/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SnapKit.framework/SnapKit /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/SnapKit/5.0.1/Build/Products/Release-iphonesimulator/SnapKit.framework/SnapKit -output /Users/zhangsaidong/Desktop/test/Carthage/Build/iOS/SnapKit.framework/SnapKit) failed with exit code 1:
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/SnapKit/5.0.1/Build/Intermediates.noindex/ArchiveIntermediates/SnapKit/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SnapKit.framework/SnapKit and /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/SnapKit/5.0.1/Build/Products/Release-iphonesimulator/SnapKit.framework/SnapKit have the same architectures (arm64) and can't be in the same fat output file

Building universal frameworks with common architectures is not possible. The device and simulator slices for "SnapKit" both build for: arm64
Rebuild with --use-xcframeworks to create an xcframework bundle instead.
zhangsaidong@zhangsaidongs-MacBook-Pro test % carthage update --platform iOS --use-xcframeworks
*** Fetching SnapKit
*** Checking out SnapKit at "5.0.1"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.w2ACyI.log
*** Building scheme "SnapKit" in SnapKit.xcworkspace
zhangsaidong@zhangsaidongs-MacBook-Pro test % carthage update --use-xcframeworks
*** Cloning RxSwift
*** Checking out RxSwift at "6.1.0"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.ZgiMrd.log
*** Downloading RxSwift.framework binary at "Ethan.1"
*** Building scheme "RxBlocking" in Rx.xcworkspace
*** Building scheme "RxRelay" in Rx.xcworkspace
*** Building scheme "RxSwift" in Rx.xcworkspace
*** Building scheme "RxCocoa" in Rx.xcworkspace
*** Building scheme "RxTest" in Rx.xcworkspace
Last login: Sat Apr 24 16:54:56 on ttys004
c%                                                                              zhangsaidong@zhangsaidongs-MacBook-Pro ~ % cd /Users/zhangsaidong/Desktop/project/CommonlyUsed/RunInto-Apple/RunInto/RunInto
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % cd ..
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % pod install
Analyzing dependencies
Downloading dependencies
Removing Bagel
Removing ResponseDetective
Removing Reveal-SDK
Generating Pods project
Integrating client project
Pod installation complete! There are 75 dependencies from the Podfile and 90 total pods installed.
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 75 dependencies from the Podfile and 90 total pods installed.
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 75 dependencies from the Podfile and 90 total pods installed.
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks
*** Fetching CocoaDebug
A shell task (/usr/bin/env git fetch --prune --quiet https://github.com/CocoaDebug/CocoaDebug.git refs/tags/*:refs/tags/* +refs/heads/*:refs/heads/* (launched in /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/dependencies/CocoaDebug)) failed with exit code 128:
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks
*** Cloning CocoaDebug
A shell task (/usr/bin/env git clone --bare --quiet https://github.com/CocoaDebug/CocoaDebug.git /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/dependencies/CocoaDebug) failed with exit code 128:
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks
*** Cloning TangramKit
*** Checking out TangramKit at "1.4.2"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.p4tLc5.log
*** Building scheme "TangramKit" in TangramKit.xcodeproj
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % pod install
Analyzing dependencies
Downloading dependencies
Removing TangramKit
Generating Pods project
Integrating client project
Pod installation complete! There are 73 dependencies from the Podfile and 88 total pods installed.
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 73 dependencies from the Podfile and 88 total pods installed.
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks
*** Cloning CocoaDebug
^C
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks
*** Fetching CocoaDebug
^C
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks
*** Cloning SQLite.swift
*** Checking out SQLite.swift at "70fb7af324cb3170d921f135f0c84cbdb6487cc2"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.WCcwXI.log
*** Building scheme "SQLite tvOS" in SQLite.xcodeproj
*** Building scheme "SQLite Mac" in SQLite.xcodeproj
*** Building scheme "SQLite watchOS" in SQLite.xcodeproj
*** Building scheme "SQLite iOS" in SQLite.xcodeproj
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks
*** Cloning CocoaDebug
^C
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks
*** Cloning Surge
*** Checking out Surge at "2.3.2"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.0VCdna.log
*** Building scheme "Surge-tvOS" in Surge.xcworkspace
*** Building scheme "Surge-watchOS" in Surge.xcworkspace
*** Building scheme "Surge-iOS" in Surge.xcworkspace
*** Building scheme "Surge-macOS" in Surge.xcworkspace
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks
*** Cloning InterfaceKit
*** Checking out InterfaceKit at "6c54d468ae1a5c45fc68d800c86e0edd728f913c"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.FScun9.log
*** Building scheme "InterfaceKit" in InterfaceKit.xcworkspace
Build Failed
    Task failed with exit code 1:
    /usr/bin/xcrun dsymutil /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/6c54d468ae1a5c45fc68d800c86e0edd728f913c/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/BuildProductsPath/Release-iphoneos/InterfaceKit.framework/InterfaceKit -o /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/6c54d468ae1a5c45fc68d800c86e0edd728f913c/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/BuildProductsPath/Release-iphoneos/InterfaceKit.framework.dSYM

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.FScun9.log
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks
*** Fetching InterfaceKit
*** Checking out InterfaceKit at "6c54d468ae1a5c45fc68d800c86e0edd728f913c"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.QqfIWe.log
*** Building scheme "InterfaceKit" in InterfaceKit.xcworkspace
Build Failed
    Task failed with exit code 1:
    /usr/bin/xcrun dsymutil /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/6c54d468ae1a5c45fc68d800c86e0edd728f913c/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/BuildProductsPath/Release-iphoneos/InterfaceKit.framework/InterfaceKit -o /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/6c54d468ae1a5c45fc68d800c86e0edd728f913c/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/BuildProductsPath/Release-iphoneos/InterfaceKit.framework.dSYM

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.QqfIWe.log
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % open /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks
*** Fetching InterfaceKit
*** Checking out InterfaceKit at "4c1d617d73bd40393e71741b39c9e2ead3c7572d"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.dM9GjZ.log
*** Building scheme "InterfaceKit" in InterfaceKit.xcworkspace
Build Failed
    Task failed with exit code 1:
    /usr/bin/xcrun dsymutil /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/4c1d617d73bd40393e71741b39c9e2ead3c7572d/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/BuildProductsPath/Release-iphoneos/InterfaceKit.framework/InterfaceKit -o /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/4c1d617d73bd40393e71741b39c9e2ead3c7572d/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/BuildProductsPath/Release-iphoneos/InterfaceKit.framework.dSYM

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.dM9GjZ.log
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks
*** Fetching InterfaceKit
*** Checking out InterfaceKit at "4c1d617d73bd40393e71741b39c9e2ead3c7572d"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.XFquCD.log
*** Building scheme "InterfaceKit" in InterfaceKit.xcworkspace
Build Failed
    Task failed with exit code 1:
    /usr/bin/xcrun dsymutil /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/4c1d617d73bd40393e71741b39c9e2ead3c7572d/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/BuildProductsPath/Release-iphoneos/InterfaceKit.framework/InterfaceKit -o /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/4c1d617d73bd40393e71741b39c9e2ead3c7572d/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/BuildProductsPath/Release-iphoneos/InterfaceKit.framework.dSYM

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.XFquCD.log
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --no-use-binaries
*** Fetching InterfaceKit
^C
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --no-use-binaries
*** Fetching InterfaceKit
*** Checking out InterfaceKit at "4c1d617d73bd40393e71741b39c9e2ead3c7572d"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.KPX9mF.log
*** Building scheme "InterfaceKit" in InterfaceKit.xcworkspace
A shell task (/usr/bin/xcrun lipo -create /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/4c1d617d73bd40393e71741b39c9e2ead3c7572d/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/InterfaceKit.framework/InterfaceKit /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/4c1d617d73bd40393e71741b39c9e2ead3c7572d/Build/Products/Release-iphonesimulator/InterfaceKit.framework/InterfaceKit -output /Users/zhangsaidong/Desktop/project/CommonlyUsed/RunInto-Apple/RunInto/Carthage/Build/iOS/InterfaceKit.framework/InterfaceKit) failed with exit code 1:
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/4c1d617d73bd40393e71741b39c9e2ead3c7572d/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/InterfaceKit.framework/InterfaceKit and /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/4c1d617d73bd40393e71741b39c9e2ead3c7572d/Build/Products/Release-iphonesimulator/InterfaceKit.framework/InterfaceKit have the same architectures (arm64) and can't be in the same fat output file

Building universal frameworks with common architectures is not possible. The device and simulator slices for "InterfaceKit" both build for: arm64
Rebuild with --use-xcframeworks to create an xcframework bundle instead.
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --no-use-binaries --use-xcframeworks
*** Fetching InterfaceKit
*** Checking out InterfaceKit at "4c1d617d73bd40393e71741b39c9e2ead3c7572d"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.SrsXrV.log
*** Building scheme "InterfaceKit" in InterfaceKit.xcworkspace
Build Failed
    Task failed with exit code 1:
    /usr/bin/xcrun dsymutil /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/4c1d617d73bd40393e71741b39c9e2ead3c7572d/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/BuildProductsPath/Release-iphoneos/InterfaceKit.framework/InterfaceKit -o /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/4c1d617d73bd40393e71741b39c9e2ead3c7572d/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/BuildProductsPath/Release-iphoneos/InterfaceKit.framework.dSYM

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.SrsXrV.log
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --no-use-binaries --use-xcframeworks
*** Fetching InterfaceKit
*** Checking out InterfaceKit at "6fbe972cef5ec57adf09e90fb18abf178279f05d"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.ztpFGs.log
*** Building scheme "InterfaceKit" in InterfaceKit.xcworkspace
Build Failed
    Task failed with exit code 1:
    /usr/bin/xcrun dsymutil /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/6fbe972cef5ec57adf09e90fb18abf178279f05d/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/BuildProductsPath/Release-iphoneos/InterfaceKit.framework/InterfaceKit -o /Users/zhangsaidong/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/InterfaceKit/6fbe972cef5ec57adf09e90fb18abf178279f05d/Build/Intermediates.noindex/ArchiveIntermediates/InterfaceKit/BuildProductsPath/Release-iphoneos/InterfaceKit.framework.dSYM

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.ztpFGs.log
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % carthage update --use-xcframeworks                  
*** Fetching InterfaceKit
*** Checking out InterfaceKit at "55b358119d90ce36475caaefb052d0a83dc7e404"
*** xcodebuild output can be found in /var/folders/6l/1l7ck2ln26l__7d011xpj3q00000gn/T/carthage-xcodebuild.5gb46Q.log
*** Building scheme "InterfaceKit" in InterfaceKit.xcworkspace
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto % cd ..
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto-Apple % git add .
g%                                                                                                                                            zhangsaidong@zhangsaidongs-MacBook-Pro RunInto-Apple % git commit -m "fix"
[master 64157fda] fix
 9 files changed, 430 insertions(+), 419 deletions(-)
 rewrite RunInto/RunInto/SwiftUI/Home/child/Setting/interface/InterfaceView.swift (98%)
 rewrite RunInto/RunInto/SwiftUI/Home/child/Setting/interface/WCInterfaceView.swift (98%)
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto-Apple % git push
Enumerating objects: 53, done.
Counting objects: 100% (53/53), done.
Delta compression using up to 16 threads
Compressing objects: 100% (27/27), done.
Writing objects: 100% (28/28), 364.31 KiB | 3.72 MiB/s, done.
Total 28 (delta 17), reused 0 (delta 0)
remote: Resolving deltas: 100% (17/17), completed with 16 local objects.
To https://github.com/adong666666/RunInto-Apple.git
   5dc30f04..64157fda  master -> master
zhangsaidong@zhangsaidongs-MacBook-Pro RunInto-Apple % 

文章作者: 张赛东
文章链接: https://zsd.name
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 张赛东 !
评论
  目录