Search code examples
androidadb

Android adb:opendir failed permission denied


I try to use adb to connect my android device:

C:\Users\vince>adb shell
shell@M3s:/ $ su root
enter main
start command :am start -a android.intent.action.MAIN -n com.android.settings/com.meizu.settings.root.FlymeRootRequestActivity --ei uid 2000 --ei pid 3472 > /dev/null
shell@M3s:/ # cd data
shell@M3s:/data # ls
opendir failed, Permission denied
255|shell@M3s:/data #

I got the #,but the permission is denied


Solution

  • In past it was easy for anyone to ROOT the mobile device for any purpose. But now for user's security, Android has made it really tough to ROOT the android device. There are still some ways and 3rd party software available that can help you in ROOTing the device. But doing so may harm your device or data.

    A Workaround for Developers If you are an android developer and want to test your app using ADB like accessing your app's SQLite DB, then I'll suggest you to use android's emulators. They are purpose built emulators and I think they are ROOTED by default. Currently connecting to those emulators through ADB is really easy and requires no SU access.

    NOTE If you are not an Android developer and want to get ROOT access for cracking / unlocking your device then you may need to play with your device's kernel and any mistake can lead to a non-recoverable damage to your device or to your data.