How to get the best out of the App Store

Over the last few months, many Mac users have suffered grief with Apple’s App Store, particularly with updates. The latest update to Big Sur, macOS 11.3, includes further changes in the App Store app, but Apple hasn’t provided any details about those in its release notes. This article explains how you can make App Store updates as painless as possible, particularly in Big Sur.

Getting updates promptly

Don’t wait for the app’s Dock icon or notifications to show that there are updates waiting in the App Store: when you’ve got a moment, open the App Store app, select the Updates item at the left, and when the list of updates appears, press Command-R to prompt the app to find all your latest updates. Even when there are already updates available, this often reveals more. If you don’t do this, you may not get alerted to those updates for another day or two.

I have quite a lot of App Store apps installed here. According to the app, around 179. To keep them all up to date, I check in with the App Store twice a day – first thing in the morning, and in the evening. Your mileage should be rather lower than mine, of course.

Download strategy

My Internet connection is rural and dog-slow, so I make a point of manually downloading each waiting update, one at a time. If you’ve got hundreds of MB per second, then it might be worth clicking on the button to update them all at once, but those of us with limited bandwidth will find it best to proceed more deliberately.

How App Store updates work

The normal sequence of events during each update runs thus:

  1. appstored, the daemon doing much of the work, creates a temporary download folder in a path starting /var/folders/sz/ on your startup Data volume.
  2. It then downloads the update’s pre-flight package, named preflight.pfpkg, to that folder.
  3. The App Store app displays its progress circle at 0% completed.
  4. ‘Purchase’ of the update is completed with the Store.
  5. The preamble task is run, to perform preflight checks.
  6. Download of the update payload, an Installer package, starts.
  7. FairPlay decryption is “chained”.
  8. During download, the progress circle is updated every second or so.
  9. Once the download is complete, with the progress circle at about 80% complete (around 9:30 by the clockface), installation starts.
  10. appstored checks the updated app isn’t running before moving the updated app from the temporary folder to its installed location.
  11. Postamble checks are performed.
  12. Three extended attributes are set on the updated app: com.apple.appstore.store_cohort, com.apple.appstore.storefront and com.apple.appstore.vendor_name.
  13. The persisted SoftwareMap at ~/Library/Caches/com.apple.appstoreagent/SoftwareMap is updated, and observer processes are notified of this change.
  14. The temporary download folder is deleted.
  15. A new LSApplicationRecord is created for the updated app.
  16. The updated app’s Spotlight metadata is indexed.

How App Store updates fail

Early failure normally indicates a problem with the App Store itself, or with preflight checks. Included at that stage, before any downloading begins, is that there’s sufficient free disk space on the Data volume to accommodate the update. In some cases, such as Xcode, that can be a high hurdle. This is also a stage in which signature errors can occur.

Once the progress circle has started to fill, until it reaches the 80% mark, slow progress or failure is most probably a problem with the connection to the App Store server. Once progress reaches 80%, this changes markedly, as shown in the graph below.

In this case, the update was small and behaved very differently from large updates such as Xcode: once 80% completion was reached, progress accelerated rather than slowed. With larger or more difficult updates, it’s at that point that progress usually becomes very slow or even grinds to a halt. In the case of Xcode this reflects the speed of the installation process, which has to create hundreds of thousands of items within the updated app.

Because downloading has completed at the 80% point, it’s then that you can start the next update when you’re controlling this manually and have limited bandwidth.

There isn’t much that you can do to accelerate slow installations once they’re more than 80% complete, and in some cases it can take more than half an hour for the progress circle to close.

If you want to check on the progress of any App Store update or installation, the key sub-system to tune into in the log is com.apple.appstored. In an article next week, I will explore the App Store in greater detail, including Crossfire.

Content Caching Server

If you have App Store apps installed on more than one Mac connected to the same Apple ID, then you should be running a local Content Caching Server, as described here. This ensures that each app and updates – including those for macOS itself – are only downloaded once. It also improves the reliability, as all the hard work is done for you by the server. I used to have to copy across Xcode to each of my Macs whenever it was updated. Now I simply update it using the App Store app and my local Content Caching server.