Skip to content

Error when try to write into /Library/LaunchAgents #6

@trinhtran-markany

Description

@trinhtran-markany

Hi,

I tried to save plist file in global agent by changing userDomainMask -> localDomainMask
let library = try FileManager.default.url(for: .libraryDirectory, in: .localDomainMask, appropriateFor: nil, create: false)

then i got error in macOS Ventura 13.2.1

Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “com.test.plist” in the folder “LaunchAgents”." UserInfo={NSFilePath=/Library/LaunchAgents/com.test.plist, NSUnderlyingError=0x600000d4b870 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}

***Note that my application built with sandbox is off.

Do you have any idea?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions