4

I was amused to see no one have ever asked such a question here before. After a little research in google I found only a few links to root a device in avd. Somewhere I also read that the sdk is already rooted and you just want to install an application which allows other applications to launch as root (am not sure about this).

The reason why I asked this question here in information security is because rooted devices are a must for Penetration testing an android app. So what I am looking for is a step by step tutorial to root a virtual device in my sdk. I have already created a device with android 2.3. Thanks in advance.

  • 3
    Possibly answered here: stackoverflow.com/a/6084432/1693208. To "root" an Android instance, you have to replace the su binary. To achieve this, the /system partition has to be remounted read-writable. adb shell should have the capabilities to do this on an emulated instance. – Lukas Dec 5 '14 at 9:37
  • You don't already have root shell when you connect to it with adb? – domen Dec 5 '14 at 10:16
  • I think I have already a root shell and root is enabled. But to launch applications as root, and access su in device terminal i might need to root the device. – Anandu M Das Dec 5 '14 at 10:18
  • What is it exactly that you're trying to do (define what "root the device" means)? Install SuperUser APK? Install a custom "su" at a predefined path, and chmod 4755 it? – domen Dec 5 '14 at 10:30
  • adb root should also work – atdre Oct 12 '16 at 16:00
0

In the emulator which you run as part of Android SDK, the adb has root permissions. That is, it can run with UID as 0. Check it with, adb shell id or whoami. If it is not root, run su in the shell which will give you root access. In some custom images like Lineage you can start adb with su permissions by using adb root.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.