Skip to content

macOS .app bundle triggers Rosetta prompt on Apple Silicon (missing LSRequiresNativeExecution) #27587

@KiloNiner

Description

@KiloNiner

Prerequisites

Summary

Double-clicking /Applications/PowerShell.app on an Apple Silicon Mac produces a "To open PowerShell, you need to install Rosetta" prompt, even though the installed pwsh binary from the osx-arm64 package is a native arm64 Mach-O. Launching pwsh from a terminal works fine without any Rosetta prompt.

Steps to reproduce

  1. On an Apple Silicon Mac, download and install powershell-7.6.2-osx-arm64.pkg.
  2. Open Finder and double-click /Applications/PowerShell.app.
  3. macOS prompts to install Rosetta.

By contrast, running pwsh from Terminal launches PowerShell directly with no prompt.

Expected behavior

PowerShell.app (from the osx-arm64 package) should launch natively on Apple Silicon without prompting for Rosetta.

Actual behavior

Launch Services offers/requires Rosetta to launch the bundle.

Root cause

The bundle's Info.plist has no architecture hint, and CFBundleExecutable points to a shell script rather than a Mach-O binary:

$ /usr/libexec/PlistBuddy -c "Print" /Applications/PowerShell.app/Contents/Info.plist
Dict {
    CFBundleShortVersionString = 7.6.2
    CFBundleIdentifier = com.microsoft.powershell
    CFBundleName = PowerShell
    CFBundleIconFile = Powershell
    CFBundleInfoDictionaryVersion = 6.0
    CFBundleGetInfoString = 7.6.2
    CFBundleExecutable = PowerShell.sh
    CFBundlePackageType = APPL
    CFBundleSupportedPlatforms = Array { MacOSX }
    CFBundleVersion = 7.6.2
}

$ cat /Applications/PowerShell.app/Contents/MacOS/PowerShell.sh
#!/usr/bin/env bash
open /usr/local/bin/pwsh

$ file /usr/local/microsoft/powershell/7/pwsh
/usr/local/microsoft/powershell/7/pwsh: Mach-O 64-bit executable arm64

$ codesign -dvv /Applications/PowerShell.app
/Applications/PowerShell.app: code object is not signed at all

Because the bundle's executable is a shell script (not a Mach-O), Launch Services cannot infer the architecture from the binary, and with the bundle unsigned and no LSRequiresNativeExecution key, it falls back to offering Rosetta on Apple Silicon. Ironically the actual pwsh that gets launched is arm64 — Rosetta would only be wrapping the launcher script.

Suggested fix (minimal)

Add to Info.plist in the arm64 package's .app bundle:

<key>LSRequiresNativeExecution</key>
<true/>

This is safe across architectures:

  • Apple Silicon: suppresses the Rosetta prompt — the underlying pwsh is already arm64.
  • Intel: the key is a no-op (no Rosetta to translate Intel binaries on Intel hardware).

Since the osx-arm64.pkg and osx-x64.pkg are already separate artifacts, the arm64 build can ship this key unconditionally.

Suggested fix (more thorough)

Replace the shell-script launcher (CFBundleExecutable = PowerShell.sh) with a real Mach-O launcher binary (or set CFBundleExecutable to a symlink/copy of pwsh) so Launch Services can determine the architecture from the executable itself. This also gives the bundle a code-signable executable for future signing/notarization.

Environment

  • macOS 27.0 (build 26A5353q) on Apple Silicon
  • PowerShell 7.6.2 from powershell-7.6.2-osx-arm64.pkg

Note: although the repro above is on a macOS 27 pre-release, the bug is in static bundle metadata (Info.plist) and Launch Services' long-standing behavior for unsigned, script-executable bundles. It should reproduce on any Apple Silicon Mac running macOS 11+.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions