Mac开发-The app must have the 'com.apple.security.device.camera' entitlement.

[access] This app has crashed because it has a hardened runtime and attempted to access privacy-sensitive data without an entitlement indicating its intent to access this data. The app must have the 'com.apple.security.device.camera' entitlement.

当mac app开启了hardened runtime时,如果entitlement文件没有正确设置,会导致程序在获取权限时崩溃。

entitlements文件中添加com.apple.security.device.camera设置为YES即可

hardruntime 有关的entitlement说明见链接
https://developer.apple.com/documentation/security/hardened_runtime_entitlements?changes=_8

Mac开发-The app must have the 'com.apple.security.device.camera' entitlement.

Resource Access栏中,根据app能力选择即可。