Skip to main content
Solved

Deploying Xcode in 2019


Forum|alt.badge.img+6

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.

Best answer by tak10

If Xcode was manually installed on the computer previously, Mac App Store Apps install option will only open the Xcode application. You will need to remove the app (in this case Xcode) and re-install using VPP / Mac App Store Apps deployment. Once the VPP deployed Xcode is installed on the computer, it should automatically maintain to the latest version going forward as long as you specifically set it up to update automatically.

I've had to follow this procedure for moving package based deployment to VPP / Mac App Store based deployment with multiple apps.

View original
Did this topic help you find an answer to your question?

39 replies

Forum|alt.badge.img+8
  • Valued Contributor
  • 87 replies
  • Answer
  • January 16, 2019

If Xcode was manually installed on the computer previously, Mac App Store Apps install option will only open the Xcode application. You will need to remove the app (in this case Xcode) and re-install using VPP / Mac App Store Apps deployment. Once the VPP deployed Xcode is installed on the computer, it should automatically maintain to the latest version going forward as long as you specifically set it up to update automatically.

I've had to follow this procedure for moving package based deployment to VPP / Mac App Store based deployment with multiple apps.


Forum|alt.badge.img+10
  • Contributor
  • 61 replies
  • January 16, 2019

To build on what @tak10 said you can push out a terminal command to remove XCode and then it should be available to "reinstall" via self service. I've seen this with other apps just like he mentioned and this workflow seems to do the trick for us.

rm -rf /Applications/Xcode.app

Forum|alt.badge.img+6
  • Author
  • Contributor
  • 97 replies
  • February 27, 2019

Sorry for the late replies. Finally having some time to sit down and mess with this some more.

So for future record if anyone else is running into the same issue:

I logged into the VPP store and got licenses for Xcode. Then in JSS, I went into the "Mac App Store Apps" option to add Xcode. Under the VPP tab there is a checkbox for 'Assign VPP Content Assign VPP content to computers with macOS 10.11 or later" that I just saw the other day which allows free apps to be assigned to computers and not users. I believe this is the correct way to deploy free apps from the Mac App Store to the computers.

The issue I'm currently running into is when installing Xcode this way through Self Service it is taking a long time on every computer, but the license seems to be available correctly. I found out our caching server is full so we're working on that which will hopefully help once one download goes through correctly.

The other issue I'm having is impatient teachers, but I don't think you guys have an easy fix for those. I think I need to figure out how to lock down iPad app updates, maybe just for Xcode, so that they don't get the version out of sync until I can get Xcode managed and automatically updated on the Macs.


Forum|alt.badge.img+1
  • New Contributor
  • 6 replies
  • February 27, 2019

@tak10 Do you know if installing it with VPP also installs the command line tools?


Forum|alt.badge.img+6
  • Author
  • Contributor
  • 97 replies
  • February 28, 2019

That I don't, sorry. It's been a while since I implemented these, but rtrouton has an Xcode post install script or package you can use here: https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/xcode_post_install_actions I don't remember if this included the command line tools, but I've been using it since I first deployed Xcode and haven't heard of anything missing from my users.


Forum|alt.badge.img+6

i tried building an Xcode 10.2.1 package with the script from rtrouton, but it seems the script doesnt run. xcode keeps asking to install additional content. when the script is run manually it installs without issues.. Do you guys expericence the same problems?


stephaniemm77
Forum|alt.badge.img+5

anyone solve this? looking to do the same thing


Forum|alt.badge.img+5
  • New Contributor
  • 20 replies
  • August 13, 2019

I have been able to package all of the post install stuff and successfully deploy it, but, each user is still prompted to install the extras that are already there.


Forum|alt.badge.img+13

If your Mac is setup with stock energy settings it will go to sleep before the initial installation can complete (on my network anyways). Xcode is like 8 GB or something. Change the setting for Turn Display Off to more than the stock 15 min (again, depends on how fast your network can deliver it). I failed 3x, changed the energy setting and it worked right away.


Forum|alt.badge.img+6
  • Author
  • Contributor
  • 97 replies
  • September 4, 2019

That's what I ended up doing. I was running out of time so I manually started my package from Self Service, but I did have to change the energy settings to prevent the computers from going to sleep while Xcode installs. I had to make an admin account for the class using Xcode for when it asks to install something during the initial launch and just in case something else would come up. Once Xcode updates I will report back if the managed app feature keeps it up to date automatically or not.


Forum|alt.badge.img+12
  • Contributor
  • 158 replies
  • October 2, 2019

I have never seen an app install SO SLOWLY. We are deploying via VPP.

It takes less time to install the entire Adobe CC 2019 suite via JAMF than it does to install XCode 11


Forum|alt.badge.img+6
  • Author
  • Contributor
  • 97 replies
  • October 9, 2019

Yeah mine are hit or miss with how long Xcode takes to install. I'm running into an issue now trying to get them all updated to 11.1. I used device-based VPP assignment but trying to use the Force Update option doesn't seem to be working for my computers. Anyone know if when using device-based assignment if I should have users set to All Users or Specific Users then leave it blank? I just read through the documentation and it doesn't say one way or the other.


Forum|alt.badge.img+2
  • New Contributor
  • 10 replies
  • November 4, 2019

I can echo how slow Xcode is to install. And it's like 13GB once installed. But it seems that as long as you wait long enough and maybe keep the machine awake like suggested above, it does seem to install.

I am also trying rtrouton's script but the updated version and still getting asked for admin login.
https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/install_xcode_command_line_tools

Is anyone having more luck?


Forum|alt.badge.img+18
  • Esteemed Contributor
  • 831 replies
  • November 13, 2019

I'm seeing the same issue even when running our version of this script.
@rtrouton Any ideas about what might have changed?

Gabe Shackney
Princeton Public Schools


FutureFacinLuke
Forum|alt.badge.img+8

My Process:

Command Line Tools for Xcode is installed as part of a package that requires it for log on auditing, the version installed is based on a per OS Smart Group and policy (10.13, 10.14, 10.15 etc...) using a common custom trigger.

Xcode installs from VPP via a Forced install for labs that require it or from Self Service for all other users.

Next I have a Smart Group: Populated by all Macs with Xcode installed (Criteria: App Has "Xcode')

Policy runs the following script on the Xcode group:

#!/bin/sh

# Post-install script for Xcode
# This script sets up and installs additional components for Xcode to prevent popups on first run for the user, then enables Developer Mode..."
# Re-written to remove DS environment variables so this will work as a standalone script
# 21-11-17
# Replaced installer commands with for loop to make this generic as xcode updates, confirmed as working on 10.3 06-07-19
# 01-04-19

echo "Starting Xcode post-install..."

# Accept Xcode License
echo "Accepting Xcode license..."
cd /Applications/Xcode.app/Contents/Developer/usr/bin/
./xcodebuild -license accept
echo "...Xcode license accepted."

# Install Additional Components
echo "Installing Xcode additional components..."
cd /Applications/Xcode.app/Contents/Resources/Packages/
for PKG in $(find /Applications/Xcode.app/Contents/Resources/Packages -name "*.pkg"); do
  /usr/sbin/installer -dumplog -verbose -pkg "${PKG}" -target /
done

echo "...Xcode components installer finished."

# This part enables Developer Mode for programming with Xcode and elevates all user privileges

# Enable Developer Mode with devtools
echo "Enabling Developer Mode..."
cd /usr/sbin/
./DevToolsSecurity -enable
echo "...Developer Mode enabled."

# Make all users members of the builtin _developer group
echo "Elevating user privileges..."
cd /usr/sbin/
./dseditgroup -o edit -a everyone -t group _developer
echo "...User privileges set."

echo "...Xcode post-install done."

exit 0

I re-wrote it with the For Loop as the PKGs inside the App changed each year, this way it just does the lot without needing a re-write each version.

I forget where I pulled the script from and the Loop section from but it works in an agile way so it's version agnostic, yet to test extensively on Catalina...


Forum|alt.badge.img+8
  • Valued Contributor
  • 96 replies
  • December 12, 2019

As @mhegge stated, it does take a long time to install. I have it set to install at deployment (a.k.a., imaging). Adobe CC installs in 17m 10s, Xcode at 21m 26s. When I excluded anti-virus (which currently installs before Xcode), I got the install time down to 12m 1s.
Does anyone have any secrets to getting Xcode to install faster?


Forum|alt.badge.img+9
  • Contributor
  • 11 replies
  • February 5, 2020

@Initialised thank you for your code, it worked like a charm for me! I was using the code from rtrouton script and my students were still getting prompted to install additional components when they launched Xcode for the first time, which required them to enter an admin password to proceed. The only additional piece I do is that I download and push the latest Xcode Command Line Tools prior to running the script, I figured it might save some time but I believe your code does that as well.


Forum|alt.badge.img+8
  • Contributor
  • 149 replies
  • February 6, 2020

@Initialised - Thanks for this. It is the exact solution I needed today!

Have you determined if it should be run on a schedule to keep up with Xcode updated or does it seem to work once, always, and forever?


Forum|alt.badge.img+9
  • Contributor
  • 11 replies
  • February 6, 2020

@Initialised @kacey3 every time Xcode updates, I download the latest Command Line Tools and I deploy to the computers with the latest Xcode installed, then I run the script after the tools are installed.


Forum|alt.badge.img+8
  • Contributor
  • 149 replies
  • February 6, 2020

Hmmm. I've got Xcode deploying through the Mac App Store Apps management tool. I think for now I'll set the install script to run monthly and hopefully that will be often enough to keep everything up to date. I can always flush the policy if I discover that the computers need authorization again.


Forum|alt.badge.img+6
  • Author
  • Contributor
  • 97 replies
  • February 21, 2020

@kacey3 how well is your Xcode policy working? I am revisiting this issue once again with the 11.3.1 update for Xcode because only a handful of my computers are updating. I logged into three of them to test things again and they started to download the updated version automatically, but the teacher is reporting that when his students log in they don't get anything.

Is anyone else running Xcode on a laptop cart? I'm afraid that's probably my biggest problem at this point since they don't stay awake while in the cart, so I can't set a good time for the Mac App Store Apps thing to push out the update.


Forum|alt.badge.img+4
  • Contributor
  • 16 replies
  • March 17, 2020

@Initialised
Were you able to test on Catalina? I am trying to make so Command Line Tools is deployed during enrollment.


Forum|alt.badge.img+4
  • New Contributor
  • 10 replies
  • April 15, 2020

Yes the script to install Command Line Tools works on Catalina...
https://github.com/rtrouton/rtrouton_scripts/blob/master/rtrouton_scripts/install_xcode_command_line_tools/install_xcode_command_line_tools.sh

The name of commandline tools changed in Catalina so you need to have the updated version of the script. Make sure it has a check for MacOS version in it.

My own version of the commandline tools update is here: https://github.com/seanism/IT/blob/master/CommandLineTools.sh


Forum|alt.badge.img+13
  • Contributor
  • 65 replies
  • April 16, 2020

@kacey3 This script worked for you? Because every time I try to open Xcode I get stopped at the agreement still. I don't think anything changed since mid February ... it's Apple though so who knows


Forum|alt.badge.img+13
  • Valued Contributor
  • 186 replies
  • October 8, 2020

I don't think you need to loop through the pkg installers anymore.

#!/bin/sh
/Applications/Xcode.app/Contents/Resources/usr/bin/xcodebuild -license accept
/Applications/Xcode.app/Contents/Resources/usr/bin/xcodebuild -runFirstLaunch  #This installs the Additional Components
/usr/sbin/DevToolsSecurity -enable
dseditgroup -o add everyone -t group _developer

That should be the barebones needed to get it working with everyone having developer privs. Of course, modify and sanity check as needed.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings