Skip to content

Instantly share code, notes, and snippets.

@vashworth
Last active February 27, 2025 02:03
Show Gist options
  • Select an option

  • Save vashworth/ba37ad7edeaa10d2cd2c1ff365f0de8c to your computer and use it in GitHub Desktop.

Select an option

Save vashworth/ba37ad7edeaa10d2cd2c1ff365f0de8c to your computer and use it in GitHub Desktop.
Running Flutter with local Dart SDK
  1. Setup Flutter engine & et
  2. Create Local Dart SDK

You may need to do:

  • ulimit -n 200000
  • Add gcloud to PATH (flutter/engine/src/flutter/buildtools/mac-arm64/gcloud/bin)
    • gcloud auth application-default login

Make any changes to any files needed

Then run ./tools/build.py --mode release --arch arm64 create_sdk

  1. Setup engine and flutter cache to use local dart SDK

I just delete the actual artifacts and symlink to the local one. Will need to delete caches after done testing so artifacts are re-downloaded.

rm -rf $FLUTTER_ROOT/bin/cache/dart-sdk
cd $FLUTTER_ROOT/bin/cache
ln -sf  /path/to/local/dart-sdk/sdk/xcodebuild/ReleaseARM64/dart-sdk
rm -rf $FLUTTER_ROOT/engine/src/flutter/prebuilts/macos-arm64/dart
rm -rf $FLUTTER_ROOT/engine/src/flutter/prebuilts/macos-arm64/dart-sdk
cd $FLUTTER_ROOT/engine/src/flutter/prebuilts/macos-arm64
ln -sf  /path/to/local/dart-sdk/sdk/xcodebuild/ReleaseARM64/dart-sdk
  1. Run flutter app with local tools & engine

Clear tools snapshot and run arbitrary flutter command to rebuild

rm $FLUTTER_ROOT/bin/cache/flutter_tools.snapshot && flutter help

Then in a flutter project et run --config ios_debug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment