Building on Catalina - permissions

Hi all.
I am a little late to the Catalina party but finally updated my build machine to the latest OS…

When I run my debug app from the Xojo IDE I get the standard OS prompt about the app requiring access to ‘Documents’ - that is fair enough. It is requesting access to some documents to load data.
I confirm the prompt and the app loads…

So two quick questions:
a) is there a test I can perform before attempting the TextInputStream.Open call or do I simply need to trap the IOException in order to detect the lack of permission to the file?
b) IS THERE ANYWAY - that I can add my debug app to the Privacy & Security DB so that the prompt is bypassed / pre-empted during development? I note that after I manually grant permission to my debug app, it appears in the Privacy & Security system preference and remains in the list after I quit the debug app… However, despite being listed with the correct permission, I still get prompted AGAIN the next time I run it. Give the app “full disk permission” doesn’t address this issue.

Just looking to understand how to deal with the change in Catalina.

Thanks very much…

To avoid the permission request on every run, you have to create a build step that sign (hardened) your debug app

Yup. That’s why I encourage everyone to CodeSign (with Hardened Runtime) each and every DebugRun on macOS, allowing you to develop and debug as close to a Release Build as possible.

You can do this such as @Antonio Rinaldi suggested. Or have a look at the example PostBuildScript Xojo2DMG. Or have a look at the most complete solution: App Wrapper.

David - you could use cfBookMarkMBS - to save bookmarks to the files you want to open every time. You’d need to save the bookmarks in a file in your app’s SpecialFolder.ApplicationData - but it saves having the prompt every time.