How to Use the assetutil Command in macOS Terminal to Inspect and Extract Assets from Compiled car Files

When developing or auditing macOS and iOS applications, graphical assets, vector shapes, app icons, and colour sets are compiled by Xcode into proprietary binary containers known as Asset Catalogs (with the .car file extension, typically named Assets.car). Because these archives are compressed and indexed using Apple’s proprietary CoreUI runtime format, standard UNIX archive utilities (like tar, unzip, or file) cannot inspect or extract their contents.

macOS includes a native command-line utility designed specifically for inspecting and parsing Asset Catalogs: assetutil. Located in /usr/bin/assetutil, this tool decodes the compiled CoreUI catalog structures and outputs comprehensive JSON metadata describing every embedded asset, resolution scale, color space, and compression codec.

Key Diagnostic Capabilities of assetutil

The assetutil command enables system administrators, reverse engineers, and Apple platform developers to:

  • Dump complete asset manifests containing asset names, scale factors (@1x, @2x, @3x), and idiom targets (Universal, Mac, iPhone, iPad).
  • Inspect compression algorithms used for individual bitmaps (e.g. lzfse, deepmap-lzfse, uncompressed).
  • Verify color gamuts (sRGB vs Display P3) to ensure proper wide-color reproduction on Retina displays.
  • Identify bloated graphic assets that contribute to excessive application download sizes.

Basic Syntax and Common Commands

1. Dumping Asset Catalog Metadata as JSON

To inspect the complete catalog structure of an application, run:

assetutil --info /Applications/Safari.app/Contents/Resources/Assets.car > safari_assets.json

This extracts a formatted JSON array where each object represents an individual catalog asset.

2. Filtering Assets Using jq in Terminal

Combine assetutil with jq to quickly filter specific assets, such as locating all assets targeting the Display P3 color space:

assetutil --info /Applications/Preview.app/Contents/Resources/Assets.car | jq '.[] | select(.DisplayGamut == "P3") | {Name: .Name, Size: .PixelWidth}'

3. Querying File Sizes and Compression Efficiencies

To locate the largest graphic resources in an application bundle:

assetutil --info Assets.car | jq -r '.[] | select(.PayloadSize != null) | [.PayloadSize, .Name] | @tsv' | sort -rn | head -n 10

Understanding Key JSON Output Attributes

Attribute Data Type Description
Name String The asset identifier referenced in application code (e.g. NSImage(named:)).
Scale Integer Screen pixel density factor (1 for standard displays, 2 for Retina).
DisplayGamut String Target color profile: sRGB or P3.
Compression String CoreUI compression codec: lzfse, zip, or palette-img.
AssetType String Class of asset: Image, Color, Icon, or Vector.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.