Of course, you are correct. I'm using Xojo and the code is a bit different. I have a class to remove files. It gets the authorisation and the uses Filemanager with authorisation to delete some files:
Private Property theFileManager As NSFileManagerMBS
Public Sub Constructor(hasAppName as String, hasAuthorization as NSWorkspaceAuthorizationMBS, doRegistration as Boolean)
AppName = hasAppName
myAuthorisation = hasAuthorization
theFileManager = NSFileManagerMBS.fileManagerWithAuthorization(myAuthorisation)
DeleteApp
if doRegistration then removeRegistration
End Sub
And Delete App:
AppFolder = SpecialFolder.Applications
if AppFolder <> nil and AppFolder.Exists then AppFolder = AppFolder.Child(AppCommon.getInstallationAppName)
if AppFolder = Nil or not AppFolder.Exists or not AppFolder.Directory then Return
dim theError as NSErrorMBS
dim theResult as Boolean = theFileManager.removeItem(AppFolder, theError)
Post
Replies
Boosts
Views
Activity
I get the same error using the Xojo IDE (url not permitted). The debugged app has an ad-hoc code certificate. Shouldn't this be enough for Instruments?
macOS 11.2 and Instruments 12.5.
Problem solved: was missing the correct entitlement.