Posts

Post not yet marked as solved
1 Replies
758 Views
Having some problems with launchd since I upgraded to Sonoma. First some background. I run a secondary userid which is logged in whenever the Mac is turned on. At startup it logs in. It contains a launchd file to run at load & lock the user, in case my Mac falls into the wrong hands. It also contains two launchd files which run an app at load & daily at 2PM. All the above worked reliably under Ventura. Focusing on the launch process now. I noticed the app was not starting up at login. Suspected that two launchd run at launch files may be a problem. So, as a test, I renamed (plist > xml) so that only the app would run at launch. When I tested it. my app did not launch, but the renamed file which locks the id still ran. Strange. Any insights as to what's happening? Thanks.
Posted
by j238.
Last updated
.
Post not yet marked as solved
3 Replies
1.9k Views
Everything I've found about SUBQUERY has told me about half of what I need to know. Sorry if the following sounds stupid I know the contents portion of SUBQUERY is the name of a propery, either NSARRAY or NSSet. Should the property be allocated & initialized before the query is executed? Should it be somehow populated? Aside from being named in the SUBQUERY argument, how should it be used ? Thanks in advance.
Posted
by j238.
Last updated
.
Post not yet marked as solved
0 Replies
304 Views
I use launchd to initiate a daily automated task that accesses the internet at 3AM. Since my MacBook is typically asleep at that time, it runs at the first wakeup. This ran reliably under Mojave with both manual and unscheduled wakeups. After Catalina install, there was an unscheduled wakeup at 4:22AM & the process started up. The first call to URLSession.shared.downloadTask did not initiate the handler until I manually started up the Mac three hours later. At that point, the process ran to normal completion. So, the process was hanging & the Mac was awake during some seemingly unnecessary internet wait process. Any insights on what cat be done to get this to work as fast & reliable as it did a week ago?
Posted
by j238.
Last updated
.
Post not yet marked as solved
3 Replies
1.1k Views
Swift app is launching an instance of itself. When it does that it sets the output using FileHandle(forWritingTo: & ends up writing to the top of the target file, not appending to the end.The output is landing in the right file, but at the top. Any idea why & how this can be fixed ? do{ let opURL = URL(string: "file:///Users/j238/output.txt") let opFile = try FileHandle(forWritingTo: self.opURL!) task.standardOutput = opFile task.standardError = opFile }catch let error as NSError { print("Ooops! Something went wrong with setting output: \(error)") }
Posted
by j238.
Last updated
.
Post not yet marked as solved
2 Replies
651 Views
This should be simple, but I can't find useful documentation or examples.in launchd, I can direct ouput where I want it. No problem.Now, I want my app to launch a fresh copy of itself using Process. Just need to set standardOutput and standardError correctly. I know that 2nd instance is running & completing accurately, just can't figure out how to direct the output. Can anyone help with this ?
Posted
by j238.
Last updated
.
Post not yet marked as solved
1 Replies
3.8k Views
I haven't found the documentation for something which may be obvious to a lot of people. I've written a Mac app for my own purposes and it runs correctly in XCode. Now, I want to run it outside XCode. Want to create a resource (believe an .app file) executable from launchd without any "debug" associations. (A few days ago, I created an .app file under a "debug" folder. Have not been able to repeat that.)The key question seems to be, exactly what Build Settings do I need to create this? Additionally, do I need to run Archive, or any other steps in addition to Build? Once I'm done, where do I find the executable? Are there any special steps needed to run it?Anyone will to help with something so elementary?
Posted
by j238.
Last updated
.