XCode 9.2 deploy with all content

Chris_Hathaway
New Contributor II

We have purchased licenses for Xcode 9.2 through VPP and pushed the app down to a lab of MacBooks. When it comes time for them to move on to the next lesson plan/task it is prompting for administrative credentials to install it. Is there an automated way to get Xcode and all of its content down to a machine without it requiring an administrator for each lesson change? Our users are students, so they are standard users. We do not wish to add them into the administrators or developers group for this to function.

8 REPLIES 8

cdev
Contributor III

Nix4Life
Valued Contributor

It will also speed things up if you have your own SUS/Caching Server

Chris_Hathaway
New Contributor II

When I get time I will test these and see if it resolves our issues. Thank you all for responding, it is appreciated.

j_meister
Contributor II

Even with Xcode 10.1 it's still mandatory to enter admin credentials after installation. Is there an easier way around now, in 2019.? Or are the scripts from Rich still the best way to handle this?

metalfoot77
Contributor II

@j.meister Hi there, did you ever get an answer on dealing with Xcode and deploying with VPP but needing additional components etc?

j_meister
Contributor II

@kricotta Hi, as far as my experience is, no. Installing a complete Xcode environment which a standard user without administrative rights can start and use right out of the box is still not possible as it seems. This is pretty bad.

jmahlman
Valued Contributor

@j.meister @kricotta

The way we do it is just have a second policy available to users after they install Xcode using VPP:

#!/bin/bash

# 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

This will install the extra stuff AND not require the user to put their admin credentials in.

If you don't use VPP, you can download the additional content from the developers portal and install it and then I think just run the second part of the script (the developer privs).

Just noticed the first post said they don't want to put the users in the developer group... I got nothing...but I'll leave this here.

j_meister
Contributor II

@jmahlman Thanks for the script, I will give it a try!