androidandroid-emulatorrootsu

Which Android Emulator image do contain 'su'?


How to know which Emulator image will contain su? I can see that often it only contains su or google play

enter image description here


Solution

  • Run adb root and you get a root shell ... otherwise su needs to be manually installed.
    However, when already having a root shell available, installing it isn't much of a problem.
    All images are rooted, but SDK apps requesting escalation of privileges do rely upon su.
    This question here generally duplicates: How to get root access on Android emulator?

    adb shell scripting must:


    Or to answer the question:

    Where stat gives this response, when it's not installed:

    stat: '/usr/bin/su': No such file or directory
    

    One could even loop all Android images installed in $ANDROID_SDK_HOME... there's no "one click" solution, but adb can be fully automated with Bash or Batch. And one wouldn't even have to run the emulator, but can mount QCOW2 as a nbd network block device.