fastlane 新增 sh 來給環信 SDK 瘦身
由於環信將 i386 x86_64 armv7 arm64 幾個平臺都合併到了一起,所以使用動態庫上傳 appstore 時需要將 i386 x86_64 兩個平臺刪除後,才能正常提交稽核。
所以我們使用 fastlane sh 在打包gym
時前後分別將 x86 的移除remove86framework
和新增add86framework
。這樣就可以繼續使用 fastlane 一鍵打包。
如果出錯,使用 pod 刪除並重新安裝完整版的環信 SDK。
Fastfile
desc "Deploy a new version to the App Store" lane :release do remove86framework gym add86framework deliver(force: true) # frameit end desc "Remove x86 framework" lane :remove86framework do sh(%( cd ../Pods/HyphenateLite/iOS_Pods_IMSDK* pwd if [! -d "./bak"]; then mkdir ./bak fi if [-d "./bak/HyphenateLite.framework"]; then rm -rf ./bak/HyphenateLite.framework fi cp -r HyphenateLite.framework ./bak lipo HyphenateLite.framework/HyphenateLite -thin armv7 -output HyphenateLite_armv7 lipo HyphenateLite.framework/HyphenateLite -thin arm64 -output HyphenateLite_arm64 lipo -create HyphenateLite_armv7 HyphenateLite_arm64 -output HyphenateLite mv HyphenateLite HyphenateLite.framework/ )) end desc "Add x86 framework back" lane :add86framework do sh(%( cd ../Pods/HyphenateLite/iOS_Pods_IMSDK* pwd if [-d "./HyphenateLite.framework"]; then rm -rf ./HyphenateLite.framework fi cp -r ./bak/HyphenateLite.framework HyphenateLite.framework )) end