Skip to main content

Is anyone deploying Xcode through the 'Mac App Store Apps' option with any success?



Our one app development class uses Xcode on the computers then tests on their iPads so I need to make sure the versions match for this to work. Previously I had been downloading Xcode and deploying manually but this is somewhat time consuming. Then if the iPad app updates that causes issues until I can get the computer app updated again.



When trying to install Xcode from the App Store through Self Service it fails, but I'm not able to find anything in the logs about why it fails. When trying to install it this way with Xcode already installed, the app itself opens but it doesn't seem to be updating to the latest version.



Anyone else having similar issues? I've deployed plenty of iPad apps this way without issue so I can't imagine it's that different.

I've just tested the following and it seems to be working. You can use modify the script so that it just has the lines that are required rather than the 'if' statement. You would just then need to scope it to a smart group that contains devices that have 'Xcode' installed. I just needed this to run ASAP and to know which computers didn't have Xcode.



#!/bin/bash

if [[ -d /Applications/Xcode.app ]]; then
echo "Xcode installed"
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -license accept
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -runFirstLaunch #This installs the Additional Components
/usr/sbin/DevToolsSecurity -enable
dseditgroup -o add everyone -t group _developer
else
echo "Xcode not installed"
exit 1
fi

@jrippy Note the above script (and I assume Xcode 12.1) changes the location of the xcodebuild process that used to be in /Applications/Xcode.app/Contents/Resources/xcodebuild
To
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild



Thats what was failing for me previously.



Gabe Shackney
Princeton Public Schools


@gshackney Thanks!


@ssc There's plenty more checking that could be done. For example, you could also use a smart group to determine which computers have Xcode installed and only scope to those.
However you want to implement it though, I was trying to provide just the needed commands to get it working.
I did have the wrong path for newer versions so I'm glad @gshackney pointed that out.


The only thing I can't remember if we need to install command line tools or is it bundled in the extra installs in the above scripting?



Gabe Shackney
Princeton Public Schools


I always install them as a separate package, just to be sure. However, there is no release version of the 12.1 CLTs (just the GM version).


@tomt yea I noticed the gm version and am considering just installing it instead of waiting. Also wondering if once the command line tools are installed can non admin users run the update for them when prompted?



Gabe Shackney
Princeton Public Schools


@gshackney Can't answer that one, I'll just push the updated CLT package if they release a full 12.1 or add the updated one to my 12.2 policy once it gets finished.


@Initialised
Your script solved my problem with Xcode 12.1 asking for additional components after install even after I though I had scripted the install for everything. Thanks so much!


So, when everyone says that Managed Distribution (VPP) Xcode installation via Self Service is slow... are you talking like upwards of an hour before it appears in the applications folder? And if you click on anywhere else within Self Service while that process is running then the "Installing..." status will revert back to the Install button?



Because that's our current experience when trying to manage Xcode via Jamf Pro. It's so bad that we're instructing our users to leverage consumer Apple IDs to install Xcode from the App Store themselves. Which is all the more frustrating for our employees since we've federated our domain with ABM for Managed Apple IDs and they're discovering that they can not use them to install free apps.



Installing Xcode the normal way via the App Store takes a reasonable amount of time considering the file size. Attempting to install via Jamf Self Service is a horrible user experience IMO.


@UESCDurandal both are god awful slow... omg I love your handle... but I digress. Yeah because both are so slo and yess VPP in Self Service is ridiculously so, I've taken to installing it as a package which is much faster. Of course that leaves you to manage the updates as well, but frankly I rather it just work and be efficiently installed.


Did Xcode installation break MacOS software updates for anyone else?


I'm hoping ppl are still following this thread. Xcode 12.4 downloaded from developer site is 11.66 GB.
I've zipped it, and uploaded to our cloud instance. Pulling that down during provisioning our eng build actually isn't that bad.
However, once it's downloaded, and then beings to extract using:
xip --expand Xcode_12.4.xip



It takes anywhere from 40 mins to 2 hrs, on both physical hardware and VMs.
Has anyone figured out a quicker way to deploy this application?
Is there another extraction tool?
Is there any sense in attempting a snapshot packaged install, or packing the 30 GB install?
The License agreements, and installing CLI only add another 15 mins.


@user-iYzHNAwDQp Hey yes we're doing almost exactly the same thing here, the difference being on premise instead of cloud. In Self Service we warn users, per @alexmcclements "This fully installs Xcode - a 12GB package, this will take a VERY loonnnnnnnggggg time, you've been warned! Requires 30GB free disk space to start."



In theory you could deploy it as a DMG, then with a script mount the DMG, and make an alias in /Applications to Xcode.app on the DMG... But I've not got the cycles to tinker with it. I've long wanted to do something similar with MS Office, at least up until the very most recent couple of versions took forever to install, first unpacking from the PKG to /tmp then using ditto to copy to /Applications, esp since each Office app is replicating 500MB of fonts? Isn't APFS supposed to have some magic to make installs like this better?