I need how to access folders (Desktop/Document/Download) programatically wihout alert i.e “Sample App” would like to access files in your Desktop/Document/Download etc folders.
would like to access files in your Desktop/Document/Download folders
That alert is a system security feature, meaning that there should be no way to bypass it without user consent (if there were, that’d be considered a security bug). For more background on this, see WWDC 2019 Session 701 Advances in macOS Security.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
$ installer -pkg ./mypackage.pkg -target /Applications
Works. So it is something in "installer" when I double click on my install
but my app just fails with a permissions error.
To start, please read On File System Permissions and specifically the discussion of responsible code.
There are various things that can prevent TCC from determining the responsible code for these operations, and thus not generate this alert. Two questions:
-
Is this request being done by your main app? Or by some other other process, like a helper tool?
-
Is your main app’s executable a Mach-O executable? Or perhaps a script of some form? (The latter is common in Java apps.)
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"