Describe the bug
When you root your phone with Magisk, looks like Magisk changed some settings and causing
adbd cannot run as root in production builds when you type adb root, and causing adb remote secure_mkdirs failed: Permission denied when you executing the bat.
This might not be a fixable bug, but I still want to post my solution due to lots of people facing this problem too, since adbd insecure and adb_root won't work on Android 12.
adb shell
su
magisk resetprop ro.debuggable 1
stop;start;
After phone restarting, you should be able to use scrcpy properly.
Note: You might need to do it again if you reboot your phone.
I wonder where this happens?
I think it can be fixed without root. Do not use adb to push dir and just mkdir in the process of scrcpy in andorid.
Hope it helps.
Environment
Describe the bug When you root your phone with Magisk, looks like Magisk changed some settings and causing
adbd cannot run as root in production builds
when you typeadb root
, and causingadb remote secure_mkdirs failed: Permission denied
when you executing the bat. This might not be a fixable bug, but I still want to post my solution due to lots of people facing this problem too, since adbd insecure and adb_root won't work on Android 12.After phone restarting, you should be able to use scrcpy properly. Note: You might need to do it again if you reboot your phone.