Posted on 12-07-2017 06:56 AM
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.
Posted on 12-07-2017 08:23 AM
Rich Trouton has a couple of scripts to handle installing additional resources and the CLI tools in his git repo:
https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/xcode_post_install_actions
Posted on 12-07-2017 01:12 PM
It will also speed things up if you have your own SUS/Caching Server
Posted on 12-12-2017 09:21 AM
When I get time I will test these and see if it resolves our issues. Thank you all for responding, it is appreciated.
Posted on 01-07-2019 11:14 PM
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?
Posted on 02-12-2019 02:38 PM
@j.meister Hi there, did you ever get an answer on dealing with Xcode and deploying with VPP but needing additional components etc?
Posted on 01-13-2020 02:59 AM
@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.
Posted on 01-13-2020 07:10 AM
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.
Posted on 01-27-2020 04:24 AM
@jmahlman Thanks for the script, I will give it a try!