I want to write a disk image (ISO, img) to an SD card, but I always get permission errno 13 (permission denied).
let diskPath = "/dev/rdisk99" guard let diskHandle = FileHandle(forWritingAtPath: diskPath) else { throw NSError(domain: "DiskWriter", code: Int(errno), userInfo: [NSLocalizedDescriptionKey: "errno \(errno)"]) }
It seems that when other macOS applications try to read from a raw block device it triggers an Access Removable Media prompt and when other applications try to write to a raw block device it triggers a Full Disk Access prompt.
How can I trigger that prompt? And then how do I elevate my write to use that permission?
P.S. I'm not a Swift coder, but I'd like to be... if it weren't that every "simple" thing I've tried launches me directly into a brick wall. :slight_smile: (not a criticism, just that the kinds of problems I like to solve tend towards uncommon and not as well supported in the ecosystem)
What I've tried
- I did change
Sandbox App
to NO inMyApp.entitlements
- I have tried manually adding my Debug Archive to Full Disk Access
Why?
As to why I'm I interested in this: Well, it just seems silly that UI tools that do what dd
does are hundreds of megabytes. Can't we do this in a UI that uses all the default macOS libraries and is just a few kilobytes (or megabytes at worst)?