Issue
How to know which Emulator image will contain su
?
I can see that often it only contains su
or google play
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:
- start the emulator
- run
adb root
- run
adb shell
- remount system partition
adb push
thesu
binarychmod
to set permissionsexit
Or to answer the question:
- start the emulator
- and check if the file exists, eg. with
adb shell stat /usr/bin/su
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.
Answered By - Martin Zeitler
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.