Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
110.1k stars 10.56k forks source link

solution to "adb remote secure_mkdirs failed: Permission denied" #3615

Open LyingYi opened 1 year ago

LyingYi commented 1 year ago

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 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.

  1. adb shell
  2. su
  3. magisk resetprop ro.debuggable 1
  4. 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.

goldenduo commented 1 year ago

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.