Skip to content

Bundle insights

As you add more features to your app, your app bundle size keeps growing. While some of the bundle size growth is inevitable as you ship more code and assets, there are many ways to minimize that growth, such as by ensuring your assets are not duplicated across your bundles or stripping unused binary symbols. Tuist Bundle Insights supports both Apple and Android bundles, providing you with tools and insights to help your app size stay small, and we also monitor your app size over time.

Usage

To analyze a bundle, you can use the tuist inspect bundle command:

Apple

bash
tuist inspect bundle App.ipa
bash
tuist inspect bundle App.xcarchive
bash
tuist inspect bundle App.app

Android

bash
tuist inspect bundle App.aab
bash
tuist inspect bundle App.apk

The tuist inspect bundle command analyzes the bundle and provides you with a link to see a detailed overview of the bundle including a scan of the contents of the bundle or a module breakdown:

Analyzed bundle

Continuous integration

To track bundle size over time, you will need to analyze the bundle on the CI. First, you will need to ensure that your CI is authenticated:

An example workflow for GitHub Actions could then look like this:

yaml
name: Build

jobs:
  build:
    steps:
      - # Build your app
      - name: Analyze bundle
        run: tuist inspect bundle App.ipa
        env:
          TUIST_TOKEN: ${{ secrets.TUIST_TOKEN }}
yaml
name: Build

jobs:
  build:
    steps:
      - # Build your app
      - name: Analyze bundle
        # .aab is recommended over .apk for more accurate size analysis
        run: tuist inspect bundle App.aab
        env:
          TUIST_TOKEN: ${{ secrets.TUIST_TOKEN }}

Once set up, you will be able to see how your bundle size evolves over time:

Bundle size graph

Pull/merge request comments

INTEGRATION WITH GIT PLATFORM REQUIRED

To get automatic pull/merge request comments, integrate your Tuist project with a Git platform.

Once your Tuist project is connected with your Git platform such as GitHub, Tuist will post a comment directly in your pull/merge requests whenever you run tuist inspect bundle: GitHub app comment with inspected bundles

Size thresholds

INTEGRATION WITH GIT FORGE REQUIRED

To use size thresholds, connect the Tuist GitHub App to your project. You can do this from your project's integrations page.

Size thresholds let you block pull requests when the bundle size increases beyond a configured percentage compared to a baseline branch. When a threshold is violated, Tuist creates a GitHub Check Run on the PR commit, blocking the merge until the size increase is resolved:

PR status check showing bundle size threshold exceeded

The check run shows the baseline size, current size, and percentage change. If the increase is intentional, you can accept it directly from the GitHub UI by clicking the Accept button:

GitHub check run showing threshold violation

Configuration

To configure thresholds, go to your project's Settings > Bundles tab:

Bundle size thresholds settings

Released under the MIT License.