Created
May 20, 2026 11:28
-
-
Save knu/d1fd0c587810e477716d940fc2a38850 to your computer and use it in GitHub Desktop.
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
| #!/bin/sh | |
| set -eu | |
| app=${1:-ArchTest.app} | |
| rm -rf "$app" | |
| mkdir -p "$app/Contents/MacOS" | |
| cat <<'PLIST' >"$app/Contents/Info.plist" | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>CFBundleDevelopmentRegion</key> | |
| <string>English</string> | |
| <key>CFBundleExecutable</key> | |
| <string>ArchTest</string> | |
| <key>CFBundleIdentifier</key> | |
| <string>org.musha.arch-test</string> | |
| <key>CFBundleInfoDictionaryVersion</key> | |
| <string>6.0</string> | |
| <key>CFBundleName</key> | |
| <string>ArchTest</string> | |
| <key>CFBundlePackageType</key> | |
| <string>APPL</string> | |
| <key>CFBundleShortVersionString</key> | |
| <string>1.0</string> | |
| <key>CFBundleVersion</key> | |
| <string>1</string> | |
| <key>LSMinimumSystemVersion</key> | |
| <string>11.0</string> | |
| <key>LSRequiresNativeExecution</key> | |
| <true/> | |
| <key>NSHighResolutionCapable</key> | |
| <true/> | |
| </dict> | |
| </plist> | |
| PLIST | |
| cat <<'SH' >"$app/Contents/MacOS/ArchTest" | |
| #!/bin/sh | |
| set -eu | |
| arch_now=$(/usr/bin/arch) | |
| uname_m=$(/usr/bin/uname -m) | |
| exec_path=$0 | |
| osascript -e "display dialog \"arch: $arch_now | |
| uname -m: $uname_m | |
| exec: $exec_path\" buttons {\"OK\"} default button \"OK\" with title \"ArchTest\"" | |
| SH | |
| chmod +x "$app/Contents/MacOS/ArchTest" | |
| echo "Created: $app" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ArchTest.app is somehow run via Rosetta2 on Apple Silicon Macs, resulting in displaying i386/x86_64.
Try adding this to your app's Info.plist to make sure it runs in arm64 mode: