macOS Catalina屏幕录制权限 [英] macOS Catalina screen recording permission

查看:1950
本文介绍了macOS Catalina屏幕录制权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用在XCode中使用C ++的屏幕录制应用程序.问题是,当我编译并启动应用程序时,我总是必须在设置>隐私"中授予屏幕录制权限.

I am working on a screen recording app using C++ in XCode. The problem is that when I compile and start the app I always have to give permission for screen recording in "Settings > Privacy".

是否有一种方法可以始终授予XCode或类似的权限?开发/测试应用程序时总是要在重新编译时手动授予权限,这确实很烦人.

Is there a way to always grant the permission in XCode or sth similar? It is really annoying when developing/testing the app to always manually grant the permission when re-compiling.

推荐答案

签署您的调试版本Luke

要授予macOS屏幕录制"开发权限(或其他任何权限,如麦克风或摄像头访问权限),您必须使用AppleID证书签署调试版本.这适用于Swift/C ++/Objective-C或任何其他语言.

Sign your debug builds Luke

In order to grant macOS "Screen Recording" permission for development (or any other permission like microphone or camera access) you must sign your debug builds with your AppleID certificate. This applies for Swift/C++/Objective-C or any other language.

这很容易且免费:

  1. 只需单击您的项目
  2. 转到签名和功能"
  3. 在签名证书"中选择开发"
  4. 在团队"中选择您的证书(如果没有证书,将出现添加团队"按钮,您可以在提供AppleID后下载免费的证书)

之后,您的构建设置应如下所示: (您可能需要使用Product-> Clean Build Folder并重建)

After that your build settings should look like that: (you may need to go use Product -> Clean Build Folder and rebuild)

此外,如果系统仍然不授予您权限,则需要转到系统设置->安全性和隐私->隐私,在适当的类别下,您需要撤消权限,并在重建后再次授予该权限.这将提示您退出应用程序-执行此操作,然后再次运行该应用程序.从现在开始,它将始终具有权限.

Also if the system still doesn't give you permissions you need to go to system Settings -> Security & Privacy -> Privacy and under an appropriate category you need to REVOKE the permission and grant it again after rebuild. This will prompt for app quit - do it and run the application again. From now on it will always have permissions.

这篇关于macOS Catalina屏幕录制权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆