When i have started to using “modern” versions of android 10 and higher, I faced the problem of remotely connecting to the phone from another device. If earlier it was possible to confirm permission for recording or broadcasting the screen once, just checking the allow always checkbox, now you need to give permission to access the screen every time.
Fortunately i have found one soution. All you need is PC (with any OS), and ADB.
Go to app info (about app section) and find the app package name, for me its com.hecorat.screenrecorder.free
Open console with path to your adb package on PC. Connect the device and type adb devices
to start adb server. You need to provide permission on your device after that.
Next command will provide screen recording permission for app. adb shell appops set com.hecorat.screenrecorder.free PROJECT_MEDIA allow
, you need to change app package name from com.hecorat.screenrecorder.free
to yours!! And that’s all!