I recently (just yesterday), updated how we’re installing Xcode on end-user systems at work and thought I might share the steps/script that we’re using.
Tools
Setup
- Install
unxip
to a common location on disk- In my case it’s
/Library/Management/Tools/unxip
unxip
is used as it is able to expand the Xcode.app file in about 3 minutes
- In my case it’s
- Download the current version of Xcode from the Apple Developer site as a
xip
- Rename Xcode to
.xip.pkg
which enables Jamf to take the upload and store it in your Cloud Distribution Point - Create a Policy in Jamf to Cache the
.xip.pkg
file only scoped to All Computers, an Ongoing recurrence, and with a Custom Trigger- I use
cache-Xcode-13.4
- I use
- Create a second policy that runs the script below
- Make sure Parameter 4 is the version of Xcode you’re deploying, eg
13.4
- Make sure Parameter 5 is the Custom Trigger you set on the first Policy, eg
cache-Xcode-13.4
- Make sure Parameter 4 is the version of Xcode you’re deploying, eg
- This policy should be available via Self Service for end-users to run
Script Walkthrough
- This script utilises
unxip
for the quick expansion of the Xcode xip on end-user systems andswiftDialog
for displaying progress to the end-user - You will need to pre-install
unxip
on end-user systems outside of this script as the release binary is not signed, nor packaged - The script will check for
swiftDialog
prior to kicking off, but because Bart provides a signed Package on his repo, the script will download/install it if not present - Once
swiftDialog
is running, it will check for the cached version of the Xcode.xip.pkg on the system. If not found that will be downloaded using your defined Custom Trigger - Once cached,
unxip
is used to unpack the.xip
and move it into place in the Applications folder.- As we don’t know if the end-user has multiple versions of Xcode in use, we are naming the app according to the format
Xcode-MAJOR.MINOR.app
- As we don’t know if the end-user has multiple versions of Xcode in use, we are naming the app according to the format
- The script will then ensure the installing user is in the correct permissions groups
- And finally we will install the underlying packages within the
.app
bundle