본문으로 바로가기

Apple

Analyze an Apple bundle by pointing tuist inspect bundle at an archive, an installable, or a built app:

bash
tuist inspect bundle App.ipa
bash
tuist inspect bundle App.xcarchive
bash
tuist inspect bundle App.app
bash
tuist inspect bundle App --platforms ios --configuration Debug

When you pass an app name instead of a path on macOS, Tuist resolves the built .app from Xcode's build products (honoring --derived-data-path when set), the same way tuist share does.

The command uploads the bundle to Tuist and returns a link to a detailed overview, including a scan of the contents and a module breakdown:

Analyzed bundle

Comparing with App Store Connect#

Tuist measures the bundle exactly as you provide it and does not apply app thinning. The reported sizes correspond to the universal (unthinned) variant — the row labeled "Universal" in App Store Connect's app file sizes report — not the per-device variants.

Expect the numbers to be in the same range as the Universal row, but not identical:

  • Install size is close to the Universal install size. App Store Connect reports a slightly higher value because it includes on-device overhead, such as filesystem block allocation and Apple's own estimation, that a raw file-size measurement does not capture.
  • Download size is lower than the Universal download size. Apple encrypts the app binary after upload, and encrypted data compresses less efficiently, so the App Store's compressed download ends up larger than the .ipa archive Tuist measures. This happens on Apple's side after upload, so it is not reflected in Tuist's number.

The per-device rows in App Store Connect are smaller again, because app thinning removes CPU architectures and asset variants that a specific device does not need. Tuist does not currently report per-device (thinned) sizes.

Understanding bundle sizes#

For every analyzed bundle, Tuist reports two values:

  • Install size: the space the app takes up once installed on a device.
  • Download size: the compressed size users download. For Apple bundles this is only reported for .ipa (the size of the archive); for .xcarchive or .app inputs it is not available.

Sizes are stored in bytes and displayed using the decimal convention, where 1 MB is 1,000,000 bytes and 1 GB is 1,000,000,000 bytes — the same convention Apple uses to report storage and app sizes (see How storage capacity is measured on Apple devices). An install size of 733,446,863 bytes shows as 733.4 MB.

Continuous integration#

To track bundle size over time, analyze the bundle on CI. First, make sure your CI is authenticated.

Tuist also needs to know which project to report the bundle to. If you have not connected the project yet, run tuist init, or declare the handle yourself:

swift
let tuist = Tuist(fullHandle: "my-account/my-project")
toml
project = "my-account/my-project"

Use tuist.toml for projects without a Swift manifest, such as Gradle projects. When both files are present, Tuist.swift takes precedence.

An example GitHub Actions workflow:

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 can 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

Restricting who can accept#

By default anyone with write access to the repository can accept a size increase, because that is who GitHub shows the button to. To narrow it, set Who can accept under Settings > Bundles:

  • Anyone: the default. Anyone with write access to the repository.
  • Selected GitHub users: only the GitHub usernames you add.

Someone not on the list leaves the check failing with an explanation, and the button stays for whoever can use it.