I tried following a few tutorials, but I get this: PowerPC Error

How can I fix this? I added in a info.plist (I just copied and pasted another app's file, and changed around a few things.)

Also, I used chmod +x myApp to make the script executable.

P.S. I am using El Capitan

  • We can't guess what you did before getting the error message. Which tutorials did you follow, after which step did you get stuck? – nohillside Jan 21 '16 at 21:18
  • 1
    I created a folder called myApp.app, then a sub folder called Contents, then MacOS, then a myApp shell script that contains #!/bin/bash ; say "Hi" ; exit 0 (With each of the commands on different lines, and w/o the semicolon). – Flare Cat Jan 21 '16 at 21:26
  • 2
    A bash script that has it execute bit set doesn't necessarily need to be placed in a bundle to be executed, simple double-click it if just in Finder or run it from Terminal. If you really want an application bundle then create it using AppleScript or Automator, the latter of which is easy. Add a Run Shell Script action and place your code in it. – user3439894 Jan 22 '16 at 11:54
  • @user3439894 I tried automater in the method you described before posting this, but the app would not run on the target computer. – Flare Cat Jan 22 '16 at 20:04
  • @user3439894 Well, for some reason I can't edit my previous comment. The error was something like 'This type of application is not supported on this computer.' – Flare Cat Jan 22 '16 at 20:24

Well, it's been years I use this simple trick to have bash scripts in application (and really really don't understand why all people try so complicated solutions as creating "Contents" folders, info.plist or use Automator or Platypus or so... ????).

  1. Create a folder named "YourApplication.app". It can be created at any location that is convenient to your usage. Though, the most OS compliant locations may be /Applications or your own ~/Applications folder.
  2. Put your script file directly in this folder the way that suites you the best (Finder, terminal etc). The script must be executable of course (use chmod +x if you need). No need for other folders or file (until you need to call other scripts or executable from within your script of course) The trick is to name your script with exactly the same name as the application folder but without extension. In the case described here the script file must be named "YourApplication".

That's all ! It works on Mac os x since Snow Leopard to Mavericks. If anybody can try on newer OS versions and tell me.

Note: The script must be at least 28 bytes in size, otherwise it will not execute. It may be padded with blank lines to achieve minimum size. Also, the first line of the script must be a shebang; e.g. #!/bin/bash or #!/bin/perl.

  • Try to add some more lines, it gives you the message you had if there is not enough lines in your script. – Pierre Lagarde Jan 16 '17 at 16:08
  • I've edited your answer to include the critical missing piece of information and up-voted it. – user3439894 Jan 16 '17 at 16:14
  • OK thanks for correction and upvoting... I've been using this since too long time and forgot about the need for 28 bytes... I don't have any script that small of course :D – Pierre Lagarde Jan 16 '17 at 16:18
  • 1
    I just tested this under macOS Sierra and it works there too. – user3439894 Jan 16 '17 at 16:19
  • 1
    @FlareCat In fact, I just checked and I guess any shebang with an existing interpreter will do (tried with perl). If you tried other languages, just tell ;). – Pierre Lagarde Feb 11 '17 at 16:24

If it is a simple shell script, then you don't need to wrap it in an application bundle; you can double-click the script itself. However, you won't get the ability to have a custom icon or other things like that.

I think there are a few helpers out there that can wrap simple scripts, but the only one that I have experience with is Platypus which allows you to make shell/python/perl/ruby/etc scripts run like regular applications with icons, I/O redirections, etc.

  • Platypus looks good, but it would be great to know how to do it manually. – Flare Cat Jan 22 '16 at 20:10
  • 1
    Tested out Platypus, works exactly how I wanted! Thanks for the suggestion. – Flare Cat Jan 23 '16 at 1:09

The currently accepted answer does not quite work for me. I get the little broken application icon.

enter image description here

The following works for me under OSX 10.15.7 (Catalina). You can feel free to change the YourApplication in all of the following instructions to be the name you really want.

  1. mkdir a directory with the .app extension in the /Applications folder with a Contents and then MacOS subdirectories.

    mkdir -p /Applications/YourApplication.app/Contents/MacOS
  2. Move your script into this directory and name it the same as the top application folder but without the .app extension and without the shell script extension:

    mv yourscript.sh /Applications/YourApplication.app/Contents/MacOS/YourApplication
  3. Make sure your script is executable:

    chmod +x /Applications/YourApplication.app/Contents/MacOS/YourApplication

Your application should now be ready and the script should run when you double click on it. It's important to note that if you rename the application, you will need to rename the underlying script.

To add an icon to your new application, you need to do the following:

  1. Find or create a PNG that you want to be your icon.

  2. Open the image in the Preview application – other graphics apps may also work.

  3. Press command-a to select all and then command-c to copy it to the clipboard.

  4. Select your application in the Finder and press command-i to Get Info window.

  5. Click on the icon in the upper left corner of the info window to select it:

    enter image description here

  6. Paste the image from the clipboard which should change the icon.

    enter image description here

You can also open up the Get Info window on other application, select it's icon, and copy it so you can paste it onto your new application. After you assign any icon, if you look in your .app directory, you should see a filename that starts with Icon.

You must log in to answer this question.

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