67
questions
0
votes
0
answers
21
views
Mac OSX Sonoma LaunchAgent Python Issue
I run a computer lab with Macintosh devices and need to enable auto logout functionality when users are idle. Unfortunately, the built-in function to do this in the operating system does not work ...
1
vote
0
answers
42
views
LaunchD spawning two instances of LaunchAgent
I have this application that is divided in 3 parts.
A server that handles all the networking code
A agent that handles all System related code
A manager (NSApplication) to interact with the other two ...
0
votes
0
answers
28
views
launchctl load and unload com.vivi.control.serviceAgent.plist get error 5: Input/output error
1、 my plist /Library/LaunchAgents/com.vivi.control.serviceAgent.plist like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1....
0
votes
0
answers
39
views
MAC os service for usb insertion and removal
i am trying to create a service for mac that triggers a python file whenever a usb is inserted or ejected in the system. My code works for this functionality but when i shut down my pc and restart the ...
0
votes
0
answers
40
views
Launch Agent unable to delete file and folder inside $HOME/Library/Containers/{yourAppFolder} macOS 14
In macOS 14 launch agent is unable to delete files and folders inside $HOME/Library/Containers/{yourAppFolder}
In older macOS (less than 14) launch agent able to uninstall the app container
I know ...
0
votes
0
answers
54
views
Spring shell prompt prints different things when run from a LaunchAgent or manually
I have a JAR file (authentication.jar) that is using org.springframework.shell to provide a simple console to generate tokens. In there is defined a custom PromptProvider:
@Component
@...
0
votes
1
answer
59
views
Shell script works when run manually, fails if run by a launch agent
I have a script that I am trying to get to run at login. The script is meant to clear the contents of the Desktop, Documents, and Downloads folders.
I'm using a launch agent to trigger the script to ...
1
vote
0
answers
80
views
Background Session Type in Launchd Agent
I followed technote by apple to get an understanding of the various session types in Launchd Agent, but I am not able to understand the 'Background' Session Type.
Briefly:
Aqua: a GUI agent; ...
0
votes
1
answer
39
views
Send Message from Chrom extension to Launch Agent Mac
Is it possible to send message from chrome extension to a launch agent or to a daemon in mac ?
1
vote
1
answer
1k
views
How to start/stop my launch agent in all logged in sessions from a root user process?
I'm writing an installer for my launch daemon, and for a launch agent, that will run in every logged in user session on macOS. The installer will be running as an admin, and thus I can install and ...
0
votes
0
answers
1k
views
How to start a launch agent on demand after the installation?
I've coded my launch daemon and a launch agent for macOS. When the app is installed, I need to run both the daemon and the agent. I place the .plist for the deamon into /Library/LaunchDaemons and then ...
0
votes
1
answer
354
views
How to keep a macOS Launch Agent open until the app that requested the service is closed?
Working on my first macOS Launch Agent using XPC.
I need the process that is delivering the service to be started by launchd and to then stay running until the client process that made the initial ...
2
votes
1
answer
514
views
Change mysql db location when installed with homebrew using Big Sur and external hard drive
Previously I had /usr/local/var/mysql symlinked to /Volumes/External/mysql meaning all my databases were stored on the external hard drive.
I have had to reformat my machine and upgrade to BigSur. If ...
0
votes
1
answer
359
views
LaunchAgent cannot access macOS "protected" folders
I have a shell script which does this:
#!/bin/bash
ls -la "$HOME/Pictures/Photos Library.photoslibrary"
When I run this script in the shell it works fine. If I define a LaunchAgent (under $...
1
vote
0
answers
82
views
Take dektop screenshot from macOS launch agent
I have the following script to take a screenshot programmatically
$ cat /Users/bamboo/capture/capture
#!/bin/bash
screencapture -o "$(dirname "$0")/screenshot.png"
When I run ...
3
votes
1
answer
2k
views
Can I use MacOS tccutil to reset ScreenRecording permissions for a daemon that has no bundleID?
I have a LaunchdAgent (e.g. /etc/someDir/myAgent) running, which asks permission to record the screen. System Popup pops - user permits screen-recording in the System-Preferences "Security & ...
0
votes
2
answers
565
views
LaunchAgent doesn't run shell script
Under macOS prior to Catalina I had a LaunchAgent that ran a shell script daily. After upgrading and switching to zsh it doesn't work. Things I've checked:
shebang switched to zsh
shell script can be ...
7
votes
0
answers
289
views
Is there a way to execute a shell script whenever a HID device is connected either directly or over bluetooth?
I'm taking advantage of macOS's hidutil command to perform custom key mappings, as per this link from Apple here. The issue is we're using a KVM which keeps disconnecting, then re-connecting the ...
3
votes
1
answer
1k
views
How to add an application as a login item for all users in Mac OSX
I am trying to add an application as login item for all users by creating an launchd plist and copying it in /Library/LaunchAgents and also by loading it.
Plist is
<?xml version="1.0" encoding="...
3
votes
2
answers
14k
views
List All Loaded/Unloaded or Both Launch Agents On macOS
I am trying to figure out how many launch agents are loaded right now using following command the it
find /System/Library/Launch* /Library/Launch* ~/Library/Launch* -name '*.plist' -exec sh -c '/usr/...
1
vote
1
answer
788
views
cocoa - how to make a non-sandbox macOS app start at login?
I am developing a non-sandbox macOS app which is not going to be released in App Store, and I want to make the app to run when user log in.
The current method I have found is to use Service ...
0
votes
0
answers
88
views
MacOS creating launch agent in a console app not working
I know how to create a launch agent with a normal application say "myLaunchd" and setting "Application is agent" to "YES" and then copying the "myLaunchd.app" to the main app's Contens/Library/...
0
votes
1
answer
352
views
Open terminal and run commands on Mac User Login
I am trying to automate a part of start up script that would open a terminal window that would run commands and display a bunch of text to user upon login.
I tried to create a plist in /Library/...
0
votes
0
answers
859
views
Run periodic tasks in the background after app terminates in MacOS
I am an iOS developer and I have developed an app that runs a periodic background task using Background Modes, I want to implement the same feature in the MacOS version of this app, as I am new to the ...
6
votes
1
answer
2k
views
Jenkins Slave Issue - invalid stream header: 099EACED
Jenkins 2.7.4 was installed in the RedHat Server and Linux Slaves is configured by Selecting "Launch agent via execution of command on master" option. We created a Shell script and it works fine in ...
0
votes
1
answer
3k
views
Launch agent via execution of command on the master options not found in jenkins Slave Setup
I was using Jenkins 1.7.4 version in RHEL Linux server. I can able to configure the slave using "launch agent via execution of command on the master" option during slave setup.
Now we have ...
1
vote
1
answer
1k
views
couldn't set DYLD_INSERT_LIBRARIES environment variable on Mac OS El Capiton [duplicate]
I am working on a project that requires wrapping libc calls particularly file i/o calls like open, read, write, close etc. I have created a shared library (say, wrapper.so) and preload this wrapper.so....
0
votes
0
answers
59
views
launchd login script doesnt work
I write the following plist:
<?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 ...
1
vote
1
answer
180
views
launchd not recognizing manually started app
I'm trying to accomplish the following with my tray app:
MyApp.app should restart on crash
MyApp.app should not launch on user-login (ie user has to manually start the app)
I have a problem that if ...
2
votes
1
answer
2k
views
How to create .plist file under /Library/LaunchAgents
I'm trying to develop a launch agent for macOS via Apple Doc
https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html
One of my ...
0
votes
1
answer
314
views
Need to launch mongod using launchctl
I have installed MongoDB using manual option.
When I fire mongod it will take parameters from somewhere else specially for dbPath.
I want to have my own dbPath without specifying it with --dbPath ...
0
votes
1
answer
341
views
How can I daemonize a grunt watch command using a launchd .plist file?
I am trying to run grunt watch when my user logs into my OS X machine, so that I don't have to run grunt watch in my $APP_ROOT dir manually every time.
I have the following org.grunt.watch.plist file ...
1
vote
0
answers
1k
views
Launch Agent Not Starting
I’m trying to make a launch agent that starts a Python script. It should run when there’s a network connection but it doesn’t do that. launchctl list says it’s loaded:
launchctl list | grep test....
1
vote
1
answer
320
views
Application do not start on system reboot
I have created a LaunchDaemon service which runs a application
sudo launchctl load /Library/LaunchDaemons/com.testapp.plist
Here is my com.testapp.plist:
<?xml version="1.0" encoding="UTF-8"?>...
0
votes
0
answers
727
views
failed to import module in python script when run using launchagents
I wrote a python script which works if I run it normally (python path/to/file.py).
I need it to run automatically every few hours. So I created a plist file in /Users/User/Library/LaunchAgents which ...
0
votes
1
answer
42
views
Launch Mac app on OS load won't work
I am trying to create a plist file, to put within the LaunchAgents of the users Mac. This plist I will use to make sure it opens a specific application every time the Mac turns on or the user logs in. ...
0
votes
1
answer
2k
views
Running command line app in the background using launchagents mac os x
I have a command line application which needs to run when the user logs in. I have added a XML file to the user's launch agent directory. The application runs but the problem is it opens the terminal ...
0
votes
1
answer
158
views
LaunchAgent with WatchPaths on mounted network share
I've got a (Synology) network share which is mounted on a Mac mini 1. I would like this share to be synced to Mac mini 2:
When the content of a specified directory is changed
Besides that, it should ...
0
votes
1
answer
88
views
Include current date as program argument in LaunchAgents
Suppose I want to do something with a file that contains the current date. At a bash prompt I could just do this:
$ touch /Foo/$(date +%Y-%m-%d)
How could I do that in a LaunchAgents plist, where I ...
0
votes
2
answers
493
views
LaunchAgent plist doesn't find path to AppleScript in iCloud
For some reason, Dropbox terminates (crashes or quits) after being online a few days, with no explanation.
I therefore started to research a way for AppleScript to automatically restart the ...
2
votes
1
answer
3k
views
fastlane: command not found when running from launchtl job
Hi I made an integration to create the builds of one IOS project using fastlane. Everything works as expected except the moment I try to launch a script to run the fastlane command on my Mac Computer ...
58
votes
10
answers
53k
views
what does launchd status 78 mean?? why my user agent not running??
I want to run a unison sync service running in the background whenever I login. But the status code of my agent is 78. I don't know why, I tried some fix posted online, but it just doesn't work.
What'...
0
votes
1
answer
2k
views
Using LaunchAgents in El Capitan (10.11)
I have a series of scripts that run at the load of one standard user, one admin user and the Default User Template. For this particular example, they configure the background and the screensaver (...
0
votes
1
answer
438
views
LaunchAgent - Pass Parameters to Application
I have a LaunchAgent which invokes an application when the user logs in. The application loads a website.
LaunchAgent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple ...
5
votes
0
answers
3k
views
Launch Agent Error Code 127
I have a plist that is supposed to run a shell script, the shell script has been chmod +x /path/to/myscript and I have checked that it runs properly. Below is my plist:
<plist version="1.0">
...
1
vote
2
answers
5k
views
OSX why my launchagent process starting as root instead of current user
I want to run the process as the current user. But it is starting as root. How can I start the process as the current user?
This script is run in postinstall in a OSX package. Packaging using ...
5
votes
1
answer
2k
views
Cannot set custom $PATH for Qt Creator on OS X 10.10
I use Qt Creator with custom build system (ninja).
The issue is that the $PATH variable passed to the Qt Creator IDE is absolutely vanilla: /usr/bin:/bin:/usr/sbin:/sbin.
So I have to write bash -c '/...
3
votes
0
answers
884
views
How to load launch daemon to have an access to WindowServer in LoginWindow context?
I am developing an application for OSX that can access to WindowServer. This application (lets call it an Agent) is first loaded for every user that is currently logged in. I am searching for running ...
0
votes
2
answers
2k
views
MAC OSX Agents - how to launch multiple instances
I am trying to create helper objects (it could be a daemon or an agent). This should be launch on demand and its multiple instances should be there, as you see for Chrome and Safari helpers.
What Have ...
0
votes
0
answers
132
views
OS X LaunchAgent - Run when desktop ready?
I've created a bash script which does some complex stuff, including some bits of Applescript which involves clicking pop ups, its to run on every new account created on the machine to set up some ...