android - 如何使用adb root (解决 adbd cannot run as root in production builds )

访问量: 26

参考:https://stackoverflow.com/questions/25271878/android-adbd-cannot-run-as-root-in-production-builds

今天在 执行 $ adb root 的时候遇到了问题. adbd cannot run as root in production builds

1. 需要你的手机是root机

2. 下载这个zip 文件: ( https://github.com/evdenis/adb_root/releases ) 

http://files.sweetysoft.com/image_after_2021_03_16/3561/adb_root.zip

3. 在magisk 中, 使用 "本地安装" 的方式, 安装这个zip 包. 重启

4. 用 专用的 USB 线 连接手机与电脑 ,并且开启开发人员选项, 选择 "传输文件" ( 不要仅充电)

5. $ adb root  即可!

注意: 还需要 $ su root 才行! 

否则会报错: permission denied. 

下面是证明

$ adb shell
merlin:/ # ifconfig
ifconfig: ioctl 8927: Permission denied
1|merlin:/ # whoami
root
merlin:/ # su root
merlin:/ # ifconfig
ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0 
          inet6 addr: ::1/128 Scope: Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:64 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:7130 TX bytes:7130 

p2p0      Link encap:Ethernet  HWaddr be:00:49:54:90:e4
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:0 TX bytes:0 

wlan0     Link encap:Ethernet  HWaddr 98:f6:21:5c:16:cf  Driver wlan
          inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0 
          inet6 addr: fe80::9af6:21ff:fe5c:16cf/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3933 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:3253 errors:1 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:3000 
          RX bytes:3407652 TX bytes:561028 

订阅/RSS Feed

Subscribe

分类/category