iOS Pipeline in .NET MAUI Fails in Azure DevOps: xcrun "actool" Error
nandu kathmandi
1
Reputation point
Hello,
I’m working on setting up an iOS pipeline for a .NET MAUI application in Azure DevOps using a YAML file. Locally, everything works as expected, but the pipeline fails with the following error:
xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find actool 2> /dev/null' failed with exit code 16384: (null) (errno=Invalid argument)
xcrun: error: unable to find utility "actool", not a developer tool or in PATH
What I've Tried
- Verified that Xcode is installed correctly on the pipeline by listing the Xcode versions and paths.
- Used
xcode-select
to ensure the correct version of Xcode is selected in the pipeline. - Locally, the xcode path works fine when executed, and the
xcrun
path resolves correctly. However, in Azure DevOps, it fails to identify theactool
path.
trigger:
- Jacobs-now-dev-mauicore
variables:
BuildConfiguration: Release
DotNetVersion: 8.0.303
iOSVersion: net8.0-ios
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
XCODE_PATH: /Applications/Xcode.app
parameters:
- name: Version
type: string
default: '15.4'
pool:
vmImage: 'macos-14'
steps:
- script: |
echo Mac OS version:
sw_vers -productVersion
echo
echo Installed Xcode versions:
ls /Applications | grep 'Xcode'
echo
echo currently selected xcode:
xcrun xcode-select --print-path
echo
echo selecting latest xcode...
sudo xcode-select -s /Applications/Xcode.app
xcrun xcode-select --print-path
xcodebuild -version
displayName: Select Xcode Version
- task: UseDotNet@2
displayName: 'Install .NET sdk'
inputs:
packageType: sdk
version: 8.0.303
installationPath: $(Agent.ToolsDirectory)/dotnet/sdk
- task: CmdLine@2
displayName: 'Install Maui Workload'
inputs:
script: 'dotnet workload install maui'
- task: InstallAppleCertificate@2
displayName: 'Install Apple P12 cert'
inputs:
certSecureFile: 'devtest.p12'
certPwd: '******'
keychain: 'temp'
- task: InstallAppleProvisioningProfile@1
displayName: 'Install Apple Provisioning Profile'
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: 'comjacobsnowdev.mobileprovision'
- script: |
dotnet restore
dotnet build --configuration Release
dotnet publish -f net8.0-ios /p:Configuration=Release /p:ArchiveOnBuild=true
displayName: 'Build and Publish .ipa'
What could be causing the actool
utility to not be found in Azure DevOps? and Is there a specific configuration required in Azure DevOps to ensure xcrun
works correctly?
Sign in to answer