Search code examples
androidadb

After unlock an Android device, how to access it via `adb shell` with `root` permission


I unlocked my Nexus 7 device, and it shows

lock state : unlocked

However, when I used adb shell to connect it, I still couldn't ls /data, and got the error opendir failed, Permission denied.

Any idea?


Solution

  • I searched a while and found the reason:

    I tried sudo ls /data, it didn't work.

    while a way that works is like:

    su // after this, you get the root permission

    ls /data