Bypass/disable macOS security measures for efficient development cycle of SFSpeechRecognizer project

落花浮王杯 提交于 2020-01-16 09:01:23

问题


I am building a macOS project that makes use of SFSpeechRecognizer, which in turn makes use of the microphone.

Each time I modify the code and rebuild, I have to:

Preferences -> Security & Privacy -> Accessibility

Then I have to:
- click the padlock
- use my fingerprint to authorise
- uncheck and recheck my app

Now I can run.

This is because I am tapping keyboard events.

But on the first run, I am additionally, as I'm using speech recognition, presented with two dialogs:
- Authorise this application to use the microphone
- Authorise this application to send speech data to Apple

These checks came in with Catalina.

It quickly becomes very frustrating having to do this every single time I need to test something. This can easily be 100 times a day.

Is there any way to bypass these security measures during the development process?

UPDATE
I tried setting a code-sign identity with Build settings -> Signing -> Codesign Identity -> Apple Development: mySigningId... as follows:

I then Product -> Clean Build Folder, just as a precaution.

I then run the project, experience the dialogs, run a second time, no dialogs this time, make a minor code change the forces rebuild (adding a space somewhere, say), run again. And the dialogs are back.

Just as a sanity check, I inspect my Info.plist, and observe:

Is there something I'm missing?

PS If anyone can suggest more suitable tags, I'm most grateful

来源:https://stackoverflow.com/questions/58783197/bypass-disable-macos-security-measures-for-efficient-development-cycle-of-sfspee

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!