2

I have created a Java application and wanted to run it as a standard application bundle. Here is the directory tree:

Snake.app
  Contents
    MacOS
      Snake
      Snake.jar
    Resources
      AppIcon.icns
    Info.plist

The Snake file just says cd $(dirname $0) then java -jar Snake.jar. Here is the Info.plist file:

<?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>CFBundleExecutable</key>
    <string>Snake</string>
    <key>CFBundleIconFile</key>
    <string>AppIcon</string>
    <key>CFBundleIconName</key>
    <string>AppIcon</string>
    <key>CFBundleIdentifier</key>
    <string>com.mosu.SnakeGame</string>
    <key>CFBundleName</key>
    <string>Snake</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.2.2</string>
    <key>LSApplicationCategoryType</key>
    <string>public.app-category.games</string>
    <key>LSMinimumSystemVersion</key>
    <string>10.6</string>
    <key>NSHumanReadableCopyright</key>
    <string>Copyright © 2020 Sebastian Swistak &quot;mOSU_&quot;</string>
</plist>

What am I doing wrong?

0
0

You should run the Snake.app/Contents/MacOS/Snake executable in Terminal to see if there's an error launching. Just Drag and drop it in Terminal and hit enter. If it launches, it's probably gatekeeper.

You can also check its permissions by running spctl -vv -a /path/to/app. If it is rejected, run

spctl --add --label "LabelForMySnakeApp" /path/to/app
spctl --enable --label "LabelForMySnakeApp"

Also see this question for some troubleshoot about codesign:

Not the answer you're looking for? Browse other questions tagged .