#Android-adb root疑难杂症帖

😟5ea1


刷完root后发现adb push被拒绝,adb root发生以下错误:
adbd cannot run as root in production builds
利用Magisk的resetprop工具修改权限

adb shell
su
  1. 设置 service.adb.root 与ro.debuggable 属性为 1
resetprop ro.debuggable 1
resetprop service.adb.root 1
  1. 配置 SELinux 权限
magiskpolicy --live 'allow adbd adbd process setcurrent'
magiskpolicy --live 'allow adbd su process dyntransition'
magiskpolicy --live 'permissive { su }'
  1. 重启 adbd 进程
kill -9 $(ps -A | grep adbd | awk '{print $2}')

再次打入adb root,发现adbd is already running as root,问题解决