Skip to main content
Question

Random Question.... Composer Capture of VPP app?

  • March 27, 2017
  • 1 reply
  • 7 views

easyedc
Forum|alt.badge.img+16
  • Esteemed Contributor
  • 629 replies

So this is a foolish question, and you may go "HUH?" when you read it, but has anyone tried to do a Composer capture of a VPP installed app? Without going into too many details, I'm looking to create a base, thick image, but package Xcode into it. With VPP, which we currently use, it's super simple. But the download and install of the SDK/Docs etc take forever, admin prompts if you're not watching, etc, we all know what happens.

I'm mid-test on this, and wonder if I'm wasting my time, but figured I'd ask anyway. Has anyone tried to capture the VPP install and add that to something like AutoDMG as an install .pkg to create a clonable, never booted image with Xcode and all it's add-ons baked in? I want it to get patched going forward via the App Store (dev-must have for timely patching they say) so I don't think the _MASReceipt trick would work like other Xcode captures.

Thanks in advance.

1 reply

Forum|alt.badge.img+16

I recently switched to VPP for Xcode in our labs. The most annoying part with that is it requires a MDM capable user to login to kick off the install, which in our environment is AD users. So it can take a while to get the install on every computer since I can't guarantee a student will sit at every computer in the period I'm hoping to push it out.

I then scope the computers with the current version to run the following script (I found the script somewhere here in JAMF and can't take credit for it at all, but I believe I added the little bit to the end to enable DevTools).

It was a recent switch, so I still have to play with what happens with today's release of 8.3.

Any suggestions of how others are doing it is greatly appreciated!

1#!/bin/bash
2
3# Accept EULA so there is no prompt
4if [[ -e "/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild" ]]; then
5/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -license accept
6fi
7
8# Just in case the xcodebuild command above fails to accept the EULA, set the license acceptance info
9# in /Library/Preferences/com.apple.dt.Xcode.plist. For more details on this, see Tim Sutton's post:
10# http://macops.ca/deploying-xcode-the-trick-with-accepting-license-agreements/
11
12if [[ -e "/Applications/Xcode.app/Contents/Resources/LicenseInfo.plist" ]]; then
13
14 xcode_version_number=`/usr/bin/defaults read "/Applications/Xcode.app/Contents/"Info CFBundleShortVersionString`
15 xcode_build_number=`/usr/bin/defaults read "/Applications/Xcode.app/Contents/Resources/"LicenseInfo licenseID`
16 xcode_license_type=`/usr/bin/defaults read "/Applications/Xcode.app/Contents/Resources/"LicenseInfo licenseType`
17
18 if [[ "${xcode_license_type}" == "GM" ]]; then
19 /usr/bin/defaults write "/Library/Preferences/"com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense "$xcode_version_number"
20 /usr/bin/defaults write "/Library/Preferences/"com.apple.dt.Xcode IDELastGMLicenseAgreedTo "$xcode_build_number"
21 else
22 /usr/bin/defaults write "/Library/Preferences/"com.apple.dt.Xcode IDEXcodeVersionForAgreedToBetaLicense "$xcode_version_number"
23 /usr/bin/defaults write "/Library/Preferences/"com.apple.dt.Xcode IDELastBetaLicenseAgreedTo "$xcode_build_number"
24 fi
25
26fi
27
28# Installing the Xcode command line tools on 10.7.x or higher
29
30osx_vers=$(sw_vers -productVersion | awk -F "." '{print $2}')
31cmd_line_tools_temp_file="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
32
33# Accept EULA so there is no prompt
34if [[ -e "/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild" ]]; then
35/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -license accept
36fi
37# Install Mobile Device Package so there is no prompt
38if [[ -e "/Applications/Xcode.app/Contents/Resources/Packages/MobileDevice.pkg" ]]; then
39/usr/sbin/installer -pkg "/Applications/Xcode.app/Contents/Resources/Packages/MobileDevice.pkg" -target /
40fi
41if [[ -e "/Applications/Xcode.app/Contents/Resources/Packages/MobileDeviceDevelopment.pkg" ]]; then
42/usr/sbin/installer -pkg "/Applications/Xcode.app/Contents/Resources/Packages/MobileDeviceDevelopment.pkg" -target /
43fi
44# Install Xcode System Resources Package, available in Xcode 8 and later
45if [[ -e "/Applications/Xcode.app/Contents/Resources/Packages/XcodeSystemResources.pkg" ]]; then
46 /usr/sbin/installer -pkg "/Applications/Xcode.app/Contents/Resources/Packages/XcodeSystemResources.pkg" -target /
47fi
48
49# Installing the latest Xcode command line tools on 10.9.x or higher
50
51if [[ "$osx_vers" -ge 9 ]]; then
52
53 # Create the placeholder file which is checked by the softwareupdate tool
54 # before allowing the installation of the Xcode command line tools.
55
56 touch "$cmd_line_tools_temp_file"
57
58 # Identify the correct update in the Software Update feed with "Command Line Tools" in the name for the OS version in question.
59
60 if [[ "$osx_vers" -gt 9 ]]; then
61 cmd_line_tools=$(softwareupdate -l | awk '/* Command Line Tools/ { $1=$1;print }' | grep "$osx_vers" | sed 's/^[[ ]]*//;s/[[ ]]*$//;s/*//' | cut -c 2-)
62 elif [[ "$osx_vers" -eq 9 ]]; then
63 cmd_line_tools=$(softwareupdate -l | awk '/* Command Line Tools/ { $1=$1;print }' | grep "Mavericks" | sed 's/^[[ ]]*//;s/[[ ]]*$//;s/*//' | cut -c 2-)
64 fi
65
66 #Install the command line tools
67
68 softwareupdate -i "$cmd_line_tools" --verbose
69
70 # Remove the temp file
71
72 if [[ -f "$cmd_line_tools_temp_file" ]]; then
73 rm "$cmd_line_tools_temp_file"
74 fi
75fi
76
77# Installing the latest Xcode command line tools on 10.7.x and 10.8.x
78
79# on 10.7/10.8, instead of using the software update feed, the command line tools are downloaded
80# instead from public download URLs, which can be found in the dvtdownloadableindex:
81# https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex
82
83if [[ "$osx_vers" -eq 7 ]] || [[ "$osx_vers" -eq 8 ]]; then
84
85 if [[ "$osx_vers" -eq 7 ]]; then
86 DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg
87 fi
88
89 if [[ "$osx_vers" -eq 8 ]]; then
90 DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_osx_mountain_lion_april_2014.dmg
91 fi
92
93 TOOLS=cltools.dmg
94 curl "$DMGURL" -o "$TOOLS"
95 TMPMOUNT=`/usr/bin/mktemp -d /tmp/clitools.XXXX`
96 hdiutil attach "$TOOLS" -mountpoint "$TMPMOUNT" -nobrowse
97 # The "-allowUntrusted" flag has been added to the installer
98 # command to accomodate for now-expired certificates used
99 # to sign the downloaded command line tools.
100 installer -allowUntrusted -pkg "$(find $TMPMOUNT -name '*.mpkg')" -target /
101 hdiutil detach "$TMPMOUNT"
102 rm -rf "$TMPMOUNT"
103 rm "$TOOLS"
104fi
105
106sleep 5
107/usr/sbin/DevToolsSecurity -enable
108/usr/sbin/dseditgroup -o edit -a everyone -t group _developer
109
110exit 0 ## Success
111exit 1 ## Failure

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