#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh | |
Note that you cannot rename appified apps. If you want to give your app | |
a custom name, use the second argument: | |
`basename "$0"` my-script.sh "My App" | |
Copyright (c) Thomas Aylott <http://subtlegradient.com/> | |
Modified by Mathias Bynens <http://mathiasbynens.be/> | |
EOF | |
exit; fi | |
APPNAME=${2:-$(basename "$1" ".sh")} | |
DIR="$APPNAME.app/Contents/MacOS" | |
if [ -a "$APPNAME.app" ]; then | |
echo "$PWD/$APPNAME.app already exists :(" | |
exit 1 | |
fi | |
mkdir -p "$DIR" | |
cp "$1" "$DIR/$APPNAME" | |
chmod +x "$DIR/$APPNAME" | |
echo "$PWD/$APPNAME.app" |
This comment has been minimized.
This comment has been minimized.
Feel free to backport these changes into your original gist if you like! It’s still your script :) I’ll update my blog post accordingly. |
This comment has been minimized.
This comment has been minimized.
Great script guys! Thanks! |
This comment has been minimized.
This comment has been minimized.
Be sure to check out Appify UI also: https://github.com/subtleGradient/Appify-UI |
This comment has been minimized.
This comment has been minimized.
I used this today to on a .sh script of mine. When launching the app it states: "You can't open the application...because PowerPC applications are no longer supported. I'm running Mountain Lion. My .sh script runs fine natively, it is small and just uses a couple curl lines to download some tar.gz files. Any ideas? |
This comment has been minimized.
This comment has been minimized.
OS X 10.8.5: |
This comment has been minimized.
This comment has been minimized.
same error message as PacoH for me, unfortunately! |
This comment has been minimized.
This comment has been minimized.
Same problem, the end result seems to be a PowerPC app. I guess it's just a matter of changing one of the triggers (?) but which one… If somebody has an idea, it would be great! |
This comment has been minimized.
This comment has been minimized.
I got around that PowerPC issue by ensuring that #!/bin/bash was at the top of my script ;) |
This comment has been minimized.
This comment has been minimized.
Running on mac OSX 10.10.2 |
This comment has been minimized.
This comment has been minimized.
Can someone post a simple .plist file that does the following...
I'll also look around + if I find a good example, post it here. Thanks. |
This comment has been minimized.
This comment has been minimized.
I made it to work on OS X 10.10 by adding file |
This comment has been minimized.
This comment has been minimized.
See also forks https://gist.github.com/advorak/1403124 and https://gist.github.com/dwallraff/5d0e37b0dc969a8c5ff5 for more options |
This comment has been minimized.
This comment has been minimized.
Neat idea. However, what directory does the script run in so that I can use relative paths? |
This comment has been minimized.
This comment has been minimized.
-bash: /Users/--------/Desktop/appify.sh: Permission denied |
This comment has been minimized.
This comment has been minimized.
@CosmicWebServices |
This comment has been minimized.
This comment has been minimized.
OS X 10.10.5: adding the Info.plist with next content didn't help:
Any ideas how to make it work on Yosemite? |
This comment has been minimized.
This comment has been minimized.
+1 any idea on how to make this work on OS X 10.10 or higher? |
This comment has been minimized.
This comment has been minimized.
I worked for me after I ran this: /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f MyAppName.app |
This comment has been minimized.
This comment has been minimized.
It started working (OS X 10.11.2) when I changed |
This comment has been minimized.
This comment has been minimized.
use this awesome utility for creating .app package no error related to power pc |
This comment has been minimized.
This comment has been minimized.
Hey guys, Just put the correct shebang on your .sh file and everything will work fine. For instance: |
This comment has been minimized.
This comment has been minimized.
Hi,
and i added the execution permission for my .sh file. The applified application dies immediately and I see the following entry in the console log:
os is 10.11.5 |
This comment has been minimized.
This comment has been minimized.
here's a hack to make it open in Mac Terminal: |
This comment has been minimized.
This comment has been minimized.
I forked this and added option-parsing, overridable icons file, and some other bits: https://gist.github.com/oubiwann/453744744da1141ccc542ff75b47e0cf |
This comment has been minimized.
This comment has been minimized.
Trying to run Electron without using electron-packager. I can get But not when I double-click from the Finder, or right-click and select "Open". Here are the repro steps:
#!/bin/bash
cd $(dirname "$0")/../../..
./node_modules/.bin/electron .
Any help would be awesome. EditLooks like it wasn't working because This works as intended: ../node_modules/electron/dist/Electron.app/Contents/MacOS/Electron . |
This comment has been minimized.
This comment has been minimized.
can any one help??? ON: OFF: |
This comment has been minimized.
This comment has been minimized.
Thanks so much for this! I tried the Automater way of doing it, but it wasn't ideal. After removing the parameter variable from my command ( |
This comment has been minimized.
This comment has been minimized.
When you're troubleshooting problems, it might look like changes to the shebang line or such things could do the trick, but they do not. The problem is that macOS caches app information which might result in things not working even after you modified the bundle. If that is the case, just run "touch" on your application's bundle. That will make macOS re-read your Info.plist. |
This comment has been minimized.
This comment has been minimized.
Adding |
This comment has been minimized.
This comment has been minimized.
You can grab out of my frameworks and just edit the script continained. |
This comment has been minimized.
This comment has been minimized.
How to add icon to this mac app generated? |
This comment has been minimized.
This comment has been minimized.
Thank you for this. Much appreciated. |
This comment has been minimized.
@mathiasbynens FTW!
Much better.
I tried to make it work using
cp
before but couldn't get it working for some strange reason. I forget the original issue I ran into.