Search code examples
androidshellresizecommandadb

Android: Is android emulator already rooted


I am trying to call shell command on a emulator programmatically from my program. I looked at the adb terminal and it was written

root@generic_x86

I can call wm size 600x800 in terminal to resize but my program can't resize.


Solution

  • adb shell session runs with shell (or root in case of emulator or rooted device) UID. Your app (and all subprocesses it spawns) still run with its own UID. You still need to manually elevate your privileges (by using su) even when running on an emulator or a rooted device.