XCode 15.4 Deployment

Jacek_ADC
Contributor II

Hello

Anyone here, which used the guide for the xcode installation from:

Deploying Xcode on managed devices (jamf.com)

everything works for me til i start to install it via self service. After downloading the pkg

i receive in my log:

no app at /Applications/Xcode.app, exiting

 

I am using the script from:

Configure Xcode post installation script with SDK download for Xcode 14 and 15 (github.com)

#!/bin/sh

export PATH=/usr/bin:/bin:/usr/sbin:/sbin

xcodePath="/Applications/Xcode.app"

if [ ! -e "$xcodePath" ]; then
    echo "no app at $xcodePath, exiting..."
    exit 1
fi

# select Xcode
xcode-select -s "$xcodePath"

# accept license
xcodebuild -license accept

# install additional components
xcodebuild -runFirstLaunch

# add everyone (every local account) to developer group
dseditgroup -o edit -a everyone -t group _developer

# enable dev tools security
DevToolsSecurity -enable

# download platform SDK

# all available platforms
# xcodebuild -downloadAllPlatforms

# update previously downloaded platforms
# xcodebuild -downloadAllPreviouslySelectedPlatforms

# download individual platforms (repeat for each)
# options are: watchOS, tvOS, and (Xcode 15+) iOS, and xrOS
#xcodebuild -downloadPlatform iOS
#xcodebuild -downloadPlatform watchOS

I tried to comment a few things in the script:

xcodePath="/Applications/Xcode.app"

#if [ ! -e "$xcodePath" ]; then
#   echo "no app at $xcodePath, exiting..."
#    exit 1
#fi

# select Xcode
xcode-select -s "$xcodePath"

# accept license
xcodebuild -license accept

# install additional components
xcodebuild -runFirstLaunch

# add everyone (every local account) to developer group
dseditgroup -o edit -a everyone -t group _developer

# enable dev tools security
DevToolsSecurity -enable

the only difference is, that the pkg is in the application folder.

Result from policy is:

[STEP 1 of 6]
Executing Policy SelfService - Xcode 15.4
[STEP 2 of 6]
Downloading Xcode-15.4.pkg...
Downloading https://xxxxx.jamfcloud.com/jcds/downloads/Xcode-15.4.pkg...
Verifying package integrity...
Installing SELFSERVICE - Xcode-15.4.pkg...
Successfully installed SELFSERVICE - Xcode-15.4.pkg.
[STEP 3 of 6]
Running script ConfigureXcode TEST2...
Script exit code: 1
Script result: 
Error running script: return code was 1.
[STEP 4 of 6]
[STEP 5 of 6]
Inventory will be updated when all queued actions in Self Service are complete.
[STEP 6 of 6]

i dont understand why the pkg is not installing the xcode app in the applications folder

someone a idea how to solve it. 

thx in advance

9 REPLIES 9

jamf-42
Valued Contributor II

Can you not use ABM / App Store to deploy Xcode ?

Check your script is set to run AFTER the pkg install 

Jacek_ADC
Contributor II

hello

thank you for your answer. The last time (maybe one year ago) when i tried to run it via appstore/abm it was running multiple hours. This was the reason i do not tested it now. 

Script is set to run after in the policy and in the script settings as well.

 

jamf-42
Valued Contributor II

It's a large download... so it can take a while.. depending on connection etc. Caching servers can help here if users are office bound. 

 

Xcode.app is a directory.. try:  ! -d 

Jacek_ADC
Contributor II
#if [ ! -d "$xcodePath" ]; then
#   echo "no app at $xcodePath, exiting..."
#    exit 1
#fi

do you mean this one?

jamf-42
Valued Contributor II

yup.. also add:

set -x 

after the shebang.. so you get all the output while testing.

#!/bin/sh

set -x

 

looking again..have you commented out the if statement?

Jacek_ADC
Contributor II

thx i forgot completely about the set -x.

Yep, i commented out now the if statement and will try with set -x

in the meantime i tried also via appstore and are running in an error after dont know how much minutes

Jacek_ADC
Contributor II
[STEP 1 of 6]
Executing Policy SelfService - Xcode 15.4
[STEP 2 of 6]
Downloading Xcode-15.4.pkg...
Downloading https://adcubum.jamfcloud.com/jcds/downloads/Xcode-15.4.pkg...
Verifying package integrity...
Installing SELFSERVICE - Xcode-15.4.pkg...
Installation failed. The installer reported: installer: Package name is Xcode
installer: Upgrading at base path / installer: The upgrade failed. (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. An unexpected error occurred while moving files to the final destination.)
[STEP 3 of 6]
Running script xcode3...
Script exit code: 127
Script result: /bin/sh: set: No such file or directory
Error running script: return code was 127.
[STEP 4 of 6]
[STEP 5 of 6]
Inventory will be updated when all queued actions in Self Service are complete.
[STEP 6 of 6]

It looks to me like you might have a corrupt pkg. I would redownload Xcode and try with a new package.   

Jacek_ADC
Contributor II

Thank you for your help guys.
The issue was using the wrong xcode version for the latest macos build.

So after reset the macbook to factory, creating a new pkg everything is working flawless.