fluttercodemagic

CodeMagic "Installing SDKs" is too slow


I'm currently using CodeMagic for my flutter project, but some jobs take a little bit long time. As you can see, "Preparing build machine" and "Installing SDKs" take nearly a minute.

codemagic_jobs

Can I cache at least just Flutter SDK in CodeMagic?

I enabled caching for these directory.

This is a part of my codemagic.yaml.

workflows:
  android-ios-workflow:
    instance_type: mac_mini_m1
    // ...
    environment:
      flutter: v3.22.1
      xcode: latest
      cocoapods: default
    // ...
    scripts:
      - name: Get Flutter packages
        script: |
          flutter packages pub get
      - name: Set up code signing settings on Xcode project
        script: |
          xcode-project use-profiles
      - name: Install pods
        script: |
          find . -name "Podfile" -execdir pod install \;
      - name: Flutter analyze
        script: |
          flutter analyze
      - name: Flutter unit tests
        script: |
          flutter test
        ignore_failure: true

Solution

  • Can I cache at least just Flutter SDK in CodeMagic?

    Technically it's about the same if you use builtin "Installing SDK" step or use cache. You still need to download/unarchive about 1GB (iirc a bit over 1GB). However with cache you need to upload 1GB when create or invalidate cache files. So I don't think it's a good idea.