In my app, when user connects usb device (phone), I use NSWorkspaceDidMountNotification
to notify user that the device is detected by performing an NSAlert
.
If accepted, app proceed to copy(read) text file contents from device. This worked fine until I enabled AppSandbox. I have enabled usb entitlement but now when app tries to copy, I get following error.
ERROR READING CONTENT OF FILE: Error Domain=NSCocoaErrorDomain Code=257 "The file “Office.txt” couldn’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=/Volumes/OfficeDrive//documents/Office.txt, NSUnderlyingError=0x600000049390 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
Is it possible to read from an USB device if AppSandbox is enabled.