# Apps in Login Items on Mac do not launch

**URL:** <https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995>\
**Category:** Processing\
**Created:** [August 29, 2021, 11:58am UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995 "2021-08-29T11:58:06Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![GeorgeRoland](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@GeorgeRoland](https://discourse.processing.org/u/GeorgeRoland)\
**Post date:** [August 29, 2021, 11:58am UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/1 "2021-08-29T11:58:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [August 29, 2021, 9:05pm UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/2 "2021-08-29T21:05:59Z")

</div>

Hi @GeorgeRoland,

Welcome to the forum! 😉

Can you open Processing without putting it in the dock?

---

<div class="post-metadata">

**Author:** ![GeorgeRoland](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@GeorgeRoland](https://discourse.processing.org/u/GeorgeRoland)\
**Post date:** [August 31, 2021, 4:23am UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/3 "2021-08-31T04:23:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![philipplehmann](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/philipplehmann/32/4111_2.png) [@philipplehmann](https://discourse.processing.org/u/philipplehmann)\
**Post date:** [August 31, 2021, 6:59am UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/4 "2021-08-31T06:59:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [August 31, 2021, 8:57am UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/5 "2021-08-31T08:57:20Z")

</div>

> [@GeorgeRoland](#):
>
> 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?

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.

---

<div class="post-metadata">

**Author:** ![GeorgeRoland](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@GeorgeRoland](https://discourse.processing.org/u/GeorgeRoland)\
**Post date:** [August 31, 2021, 1:47pm UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/6 "2021-08-31T13:47:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![GeorgeRoland](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@GeorgeRoland](https://discourse.processing.org/u/GeorgeRoland)\
**Post date:** [September 1, 2021, 6:35pm UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/7 "2021-09-01T18:35:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [September 3, 2021, 1:57am UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/8 "2021-09-03T01:57:08Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [September 3, 2021, 3:21am UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/9 "2021-09-03T03:21:38Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [September 3, 2021, 9:43am UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/10 "2021-09-03T09:43:32Z")

</div>

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:

> <https://stackoverflow.com/questions/6442364/running-script-upon-login-mac/6445525#6445525>

In this script you can do:

```bash
#!/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](https://en.wikipedia.org/wiki/Shebang_(Unix)). 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.

---

<div class="post-metadata">

**Author:** ![GeorgeRoland](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@GeorgeRoland](https://discourse.processing.org/u/GeorgeRoland)\
**Post date:** [September 3, 2021, 9:51pm UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/11 "2021-09-03T21:51:38Z")

</div>

Compiled with Java Mode.

---

<div class="post-metadata">

**Author:** ![GeorgeRoland](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@GeorgeRoland](https://discourse.processing.org/u/GeorgeRoland)\
**Post date:** [September 3, 2021, 9:55pm UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/12 "2021-09-03T21:55:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [September 4, 2021, 4:02am UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/13 "2021-09-04T04:02:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![GeorgeRoland](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@GeorgeRoland](https://discourse.processing.org/u/GeorgeRoland)\
**Post date:** [September 5, 2021, 11:42pm UTC](https://discourse.processing.org/t/apps-in-login-items-on-mac-do-not-launch/31995/14 "2021-09-05T23:42:41Z")

</div>

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!
