I'd like to launch another own application by LSOpenApplication() in Sandbox on Mac.
Of course, I added a row into 'com.apple.security.temporary-exception.files.absolute-path.read-write' in an entitlements file for launching.
However, when launching, console spat out an error which is Not allowing process xxxx to launch "foo.app" because it has not been launched previously by the user. It is able to launch without errors after launched the process manually once.
How can I launch the process even if not launch previously? Is this no relation with sandboxing?
There are very few conditions under which you'll be able to launch another application and have the desired outcome. com.apple.security.temporary-exception.files.absolute-path.read-write doesn't gain you anything with regard to LaunchServices so you can remove that entitlement.
As a sandboxed application you are fairly limited in what you can actually sub-launch, this is an intentional behavior as launching another application is technically a violation of the sandbox model. the ways available to you are:
I'd say the osascript call works because its doing roughly the same as -[NSWorkspace launchApplication:]. none of the LS calls that accept bundle identifiers or absolute/relative paths are going to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With