


Install the SuperSu app, turn off SELinux policies and set up a daemon. Tl dr: The basic idea is to get the correct su (superuser) binary from the SuperSu project by Chainfire (Jorrit Jongma), put it in the right directory, change the permissions. Now this is NOT exactly what I wanted, I wanted more!! Rooting the Emulator: (The -e just means to direct the adb connection to the emulator) Notice the # telling you that you are root. Or getting into the emulator and using su, i.e.: Getting access to the filesystem as root is as easy as running: However, this does not mean that you will be able to run apps in the emulator directly as root. This means you can access privileged directories, change file/directory permissions, put apps and binaries in certain (many?) locations (not in the system partition, unless you make it writable), and run them via the command line interface. NB: Basically, through ADB (the Android debug bridge) you can get root access to the filesystem (only). I’ve tested this on the emulator bundled in Android Studio 2.3 with an emulator running Android 4.4 (Kitkat)and 7.1.1 (Nougat).

Having struggled to easily find instructions on how to run apps as root on the Android Emulator, I’ve decided to document what worked for me.
