Skip to main content
coreydaley.dev
Docs menu

Make and open Apple Archive (.aar) files on a Mac

With Archive Utility

Archive Utility opens .aar files: double-click one and it expands next to the archive, like a ZIP. To make them, change one setting:

  1. Open Archive Utility. It’s in /System/Library/CoreServices/Applications/; the quickest way is to type “Archive Utility” in Spotlight.
  2. Choose Archive Utility ▸ Settings, and set Use archive format to Apple Archive.
  3. Choose File ▸ Create Archive…, select the folder, and click Archive. The .aar appears next to the folder.

Finder’s Compress command makes a ZIP; I didn’t test whether this setting changes that. The other choices in the menu are “compressed archive” (a .cpgz), “regular archive” (a .cpio), ZIP, and Apple Encrypted Archive, covered on the next page.

With the aa command

aa makes, lists and extracts Apple Archives:

aa archive -D ~/Projects/Site -o ~/Desktop/Site.aar
aa list -i ~/Desktop/Site.aar
mkdir -p ~/Desktop/Restored
aa extract -i ~/Desktop/Site.aar -d ~/Desktop/Restored
  • -D keeps the folder’s name inside the archive, so it extracts as Restored/Site/…. With -d instead, only the folder’s contents go in.
  • -a picks the compression: lzfse (the default), lzma, lzraven, zlib, lz4, lzbitmap, or raw for none.
  • aa list -v shows each entry’s owner, permissions, flags and times.

Which compression to use

I archived two folders with each method and took the median of three runs. One is a website project: 673 files, 48.5 MB, mostly WebP and PNG images, which are already compressed. The other is a folder of source code and documentation: 4,444 text files, 73.6 MB.

aa -aSource code: sizeTime to makeTime to extractWebsite: size
raw74.4 MB0.35 s0.29 s48.7 MB
lz47.7 MB0.34 s0.28 s46.3 MB
lzbitmap6.4 MB0.40 s0.31 s45.9 MB
zlib4.7 MB0.42 s0.28 s45.8 MB
lzfse (default)4.3 MB0.39 s0.27 s45.0 MB
lzraven3.3 MB1.33 s0.28 s44.1 MB
lzma3.2 MB1.57 s0.30 s43.8 MB

Keep the default. lzfse was about as fast as no compression at all, and made the source code 17 times smaller. lzma and lzraven saved another quarter for three to four times the wait, and extracted just as fast, so they’re worth it for something you’ll keep a long time. On the images, no method saved much: they were already compressed.

For comparison, on the same source code folder a .tar.gz was 5.0 MB and took 2.4 s, and a ZIP from zip -r was 6.3 MB in 0.7 s. The comparison page has the rest.

What it keeps

A Mac file can carry more than its contents: extended attributes (where Finder tags, “Where from” and quarantine flags live), a resource fork, permission lists (ACLs), file flags such as “hidden”, and hard links. I made a test folder with each of these, archived it in every built-in format, and extracted it again on the same Mac:

FormatExtended attributes and tagsACLsHidden flagHard linksSymbolic links
Apple Archive (aa or Archive Utility)✓✓✓✓✓
tar (macOS’s own, both ends)✓✓✓ with tar -xpf✓✓
.cpgz from ditto✓✓✗✓✓
Disk image (diskutil image)✓✓✓✗✓
Finder-style ZIP, opened on a Mac✓✓✗✗✓
Finder-style ZIP, opened with unzip✗✗✗✗✓
zip -ry✗✗✗✗✓
7z✗✗✗✗✓

Every format kept the modification time, the “executable” permission, empty folders, and a name with an accent. A Finder-style ZIP keeps Mac metadata in a hidden __MACOSX folder, which only Mac tools put back; unzip and other systems extract it as a stray folder. Apple Archive and macOS’s own tar were the only formats that kept everything, and Apple Archive was several times faster. tar kept the hidden flag only when I extracted with tar -xpf; plain tar -xf dropped it.

What can’t open it

Only Apple’s tools read Apple Archive. On this Mac, tar, 7-Zip (7zz) and The Unarchiver’s command-line tool (unar) all said they didn’t recognize a .aar file, and aa itself doesn’t read ZIP or tar files. Send a ZIP to anyone not on a Mac.