How to configure caching for your builds

You can speed up your builds by storing dependencies on Codemagic.

For example, you may consider caching the following paths:

$FLUTTER_ROOT/.pub-cacheDart cache
$HOME/.gradle/cachesGradle cache. Note: do not cache $HOME/.gradle
$HOME/Library/Caches/CocoaPodsCocoaPods cache

A great article on Unity caching can be found in our blog.

Note: Caching $HOME/Library/Developer/Xcode/DerivedData won’t help to speed up iOS builds with Xcode 10.2 or later.

Enabling dependency caching

To use caching, simply add a cache section to your codemagic.yaml file and list the paths you would like to cache.

      - ~/.gradle/caches
      - ...
  1. In your app settings, open the Dependency caching section.
  2. Check the Enable dependency caching option. By default, caching is disabled.
  3. Enter the path(s) to the dependencies to be cached and click Add. Note that you can delete added paths anytime.

Cache usage limits

Caching is limited to 1GB to avoid potential performance issues. Installing dependencies without using caching could be faster than retrieving or updating cached data.

Removing cached dependencies

In order to clear the collected cache, navigate to the Dependency caching section in app settings and click Clear cache. During the next build, dependencies will be downloaded afresh.