First of all thanks for all the information.
[quote='809677022, DTS Engineer, /thread/766464?answerId=809677022#809677022']
This is very specific to Python and I’m not really the right person to advise on that.
[/quote]
Fair enough, I'll seek advice elsewhere for that.
[quote='809677022, DTS Engineer, /thread/766464?answerId=809677022#809677022']
I recommend that you install the agent via SMAppService
[/quote]
I've created a sample project and have been doing precisely that. I followed the Embedding a command-line tool in a sandboxed app with a slight variation: no sandboxing and including a .plist for the launchd agent in Contents/Library/LaunchAgents
I've been using cx_freeze to build the application, and it produces the following structure:
.
├── frozen_application_license.txt
├── main
├── lib/
└── share/
lib/: Contains a bunch of .so and .pyc files. It also includes a Python executable and some .dylib files.
share/: Some binary files for zone_info.
Due to its nested structure, I struggled to automatically code-sign the files using Xcode. I've used a build phase script to do that manually.
If I move all that content into Contents/MacOS, the final app cannot sign. However, if I move only the main executable into Contents/MacOS and symlink the rest from Contents/Resources/lib -> Contents/MacOS/lib, I can run the main application and run the launchd agent successfully.
I don't know if that's a valid approach.
[quote='809677022, DTS Engineer, /thread/766464?answerId=809677022#809677022']
...it’ll have to be placed in an app-like wrapper.
[/quote]
Fair enough. Suppose I put the agent into an app-like structure. How exactly would I nest that into my existing application? The agents .plist would need to be inside Contents/Library/LaunchAgents of the main application. How about the rest?
Thanks!
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags: