xcode 有20种口味时如何加快扑净?

t1rydlwq  于 2023-11-21  发布在  其他
关注(0)|答案(1)|浏览(168)

我们的应用程序有很多口味(约20)。
当运行flutter clean时,flutter在内部为每种口味运行以下命令,这需要一些时间:

/usr/bin/arch -arm64e xcrun xcodebuild -workspace /Users/my_user/Documents/projects/flutter-app/ios/Runner.xcworkspace -scheme client_one clean
...
/usr/bin/arch -arm64e xcrun xcodebuild -workspace /Users/my_user/Documents/projects/flutter-app/ios/Runner.xcworkspace -scheme client_two clean

字符串
Flutter清洁可以花10分钟以上。
你知道吗?
我的设备:
MacBook Pro M1
Flutter 3.0.5 / 3.3.3

vshtjzan

vshtjzan1#

我使用下面的脚本,而不是Flutter清洁对我的笔记本电脑和我的CI。它工作得很好,但是的,需要维护它沿着Flutter升级,以不忘记一些东西.

# Reproduced the steps from flutter_sdk/package/flutter_tools/lib/src/commands/clean.dart picked from flutter 3.7.12.
# Use this if you can't use the `flutter clean` command because of the slowness of the tool if you have for example 100 or more schemes.
# Each individual xcodebuild clean can took 30s so it's too long...

if [ -f "pubspec.yaml" ]; then
    echo "Starting..."
else
    echo "You are not at the root of a flutter project !"
    exit 1
fi

rm -rf build \
  .dart_tool \
  .packages \
  android/.android \
  ios/Flutter/ephemeral \
  ios/.ios \
  ios/Flutter/Generated.xcconfig \
  ios/Flutter/flutter_export_environment.sh \
  ios/Flutter/App.framework \
  ios/Flutter/Flutter.framework \
  ios/Flutter/Flutter.podspec \
  .flutter-plugins-dependencies \
  .flutter-plugins \
  ~/Library/Developer/Xcode/Archives/* \
  ~/Library/Developer/Xcode/Products/* \
  ~/Library/Developer/Xcode/DerivedData/*

echo "Done !"

字符串

相关问题