Apps in Login Items on Mac do not launch

I am using a Macintosh
When I place a Processing App in the Login Items to launch at startup, it does not launch.
The App icon appears in the Dock and bounces a couple of times as though it is starting to launch, but then it disappears and the app does not launch.

Can anyone explain why this doesn’t work?
Thanks

1 Like

Hi @GeorgeRoland,

Welcome to the forum! :wink:

Can you open Processing without putting it in the dock?

Hi josephh,

Yes, I believe so. I keep Processing in my Applications folder and can click its icon these to launch it. Is that what you meant?

George

Do you mean an application that has been created with the Processing export function (.app)?
Or a processing sketch (.pde)?

1 Like

Yes this is what I meant. The command that is executed when you click on an application in the Dock should launch the processing executable and it should behave the same way when clicking on it in the Applications folder.

1 Like

When I completed my sketch in Processing, and it ran fine as I wanted it to, I executed the File>Export Application command in the Processing menu, which created an application folder with an app icon for the sketch. If I double-click this app icon, the work runs as intended. No problem.

The problem I am running into is, if I put this app icon in Apple’s Users and Groups Sys Prefs under items to be launched at login, the app does not launch. Its icon appears in the dock for a few seconds, bounces up and down a couple of times as though it is about to launch, then quits. This is my problem.

1 Like

Hello Philipp,

I was referring to an app created with Processing’s Export Application menu.

When I make such an app, it launches fine if I double-click it. But placed in an auto-login account’s section where an app is supposed to launch at startup, it doesn’t launch.

@GeorgeRoland - Just curious, is the source code compiled with Java mode or Android mode? I don’t want to interfere with this thread but I’ve never been able get the Export Application to work for Android on my Mac using OS 11.0.1.

@GeorgeRoland - Not sure why you’re having problems with Apple’s code. Do you know how to use Xcode? I can send you some objc code which uses NSTask to launch an app for you to try. It would be interesting to see if it will launch your Processing created app. If it does then you could try adding this app to the Apple utility.

1 Like

One solution is to catch the logs of processing when it starts so we can see if there’s errors.

To do that, you might want to create a custom script that launches your Processing executable:

In this script you can do:

#!/bin/bash

echo "Lauching Processing sketch..."

/path/to/your/sketch > ~/sketch.out

echo "Launched!"

A little explanation of the upper lines:

  1. #!/bin/bash
    This is called a shebang. It treats the file as an executable (since you are running on MacOS which is UNIX based) and tells the computer to use the provided interpreter (here /bin/bash which is a program on your computer) .

  2. echo "Lauching Processing sketch..."
    echo is a command to print something in the terminal

  3. /path/to/your/sketch
    is launching your sketch executable (make sure it’s executable, otherwise do chmod +x /path/to/your/executable). Replace the path with the real location of your processing exported sketch folder.

  4. > ~/sketch.out
    the > character is used to redirect the output (all the text printed to the console from the processing executable, this is what we want) to a file ~/sketch.out.

The ~/ path is referring to your home directory (typically /home/your_name/) where you have your Documents, Pictures, Downloads…

This you will be able to see the output of the processing sketch if there’s an error by inspecting the sketch.out file in your home directory.

1 Like

Compiled with Java Mode.

Hi Sven,

I don’t know what Xcode is or how to use it. Sorry, I’m somewhat out of my depth here I guess. Thanks for you reply.

I just compiled a Java sketch and exported the application to the Documents/Processing folder. I then used drag and drop to place the app icon in Login Items in SystemPreferences/Users & Groups and restarted the computer. The exported app opened as expected; I was unable to reproduce the problem that you describe.

2 Likes

Hi Sven,

This is the darndest thing. I tried it today and it worked perfectly. This after doing the same thing over and over and having the app fail to launch and getting a “Quit unexpectedly” error message. I can’t figure this out at all.

Thanks for your response!

1 Like