We want our system extension to generate some files, and the container app to read those files.
- We tried using app group like this:
Configuring an app group (group.com.awesomecompany.app) in both the app and system extension
FileManager.containerURL(forSecurityApplicationGroupIdentifier: "group.com.awesomecompany.app")
For the system extension, this method returns path like this: /private/var/root/Library/Group Containers/group.com.awesomecompany.app
For the container app, this method returns a path like this: /Users/username/Library/Group Containers/group.com.awesomecompany.app
So even if system extension writes a file in that path, the container app cannot access it, because app cannot read files inside /private/var/root
- We tried asking the extension to write files in user's home directory.
Although the app extension runs as 'root', but it does not seem to have the permission to write files inside ~/SomeFolder or ~/Library/Group Containers/group.com.awesomecompany.app
What would be the correct way for the container app to read files generated by the system extension?