Conversation
The scripting-targets entitlement names the target app as a dictionary key built from $(PRODUCT_BUNDLE_PREFIX:default=com.utmapp). Xcode expands it only when it signs, and the unsigned package re-signs from the raw file, so utmctl in an unsigned build was allowed to script an app with that literal name and no other: every command failed with "failed to get scripting definition" and an unrecognized selector. Expand the key before signing.
osy
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a package built with
scripts/package_mac.sh unsigned, everyutmctlcommand fails, although AppleScript to the same running UTM works.Steps
./scripts/build_utm.sh -k macosx -s macOS -a arm64 -o outand package with./scripts/package_mac.sh unsigned out.xcarchive pkg.UTM.app/Contents/MacOS/utmctl list.Result
Exit code 134.
osascript -e 'tell application "/Applications/UTM.app" to get name of every virtual machine'works in the same state.Cause and fix
utmctl's scripting-targets entitlement names the target app as a dictionary key built from$(PRODUCT_BUNDLE_PREFIX:default=com.utmapp). Xcode expands it only when it signs;package_mac.shre-signsutmctlfrom a copy of the raw file, so in an unsigned package the key stays literal andutmctlis not allowed to script UTM at all.This replaces the build-setting reference with the script's
PRODUCT_BUNDLE_PREFIXin the copiedutmctlentitlements before signing. It runs in every mode; for signed modes the value is the same one Xcode would have produced.The app-group strings in
macOS-unsigned.entitlementsandQEMUHelper-unsigned.entitlementscarry the same kind of literal, but they match each other, so UTM and the helper still share the group; changing them would move the group container of existing unsigned installs, so they are left as they are.Tested: after packaging,
codesign -d --entitlements - --xml UTM.app/Contents/MacOS/utmctlshows the targetcom.utmapp.UTM,codesign --verify --deep --strictpasses, andutmctl start/utmctl statuswork against a running unsigned UTM on macOS 26 (before the change both failed as described above).