How to root android emulator (andy) on mac

  • Thread starter Android Central Question
  • Start date
A

Android Central Question

I'm hitting a brick wall as I'm trying to root an android emulator on my mac.

I followed multiple tutorials, all of which involve the following steps:

- Installing adb (did it with homebrew)**
- Downloading and pushing Superuser.apk (done)**
- Downloading and pushing "su" (that's where the trouble comes)**

First tutorial told me to do the following:

adb push su /storage/sdcard0/
adb shell
su

the push went through no probs, but when I type su in the adb shell, it says it can't find su

shell@android:/ $ su
/system/bin/sh: su: not found

I tried to specify the path, but couldn't execute su from the sd card

127|shell@android:/ $ /storage/sdcard0/su
/system/bin/sh: /storage/sdcard0/su: can't execute: Permission denied

second tutorial told me to push su to /system/bin/ or /system/xbin

but that doesn't work because that file system is read-only

$ adb push su /system/xbin/
adb: error: failed to copy 'su' to '/system/xbin/su': remote Read-only file system

other tutorial told me to just run adb as root

adb root
adb shell

but when I do adb root, the device gets disconnected, and if I restart the device, the shell is not running as root

$ adb devices
List of devices attached
192.168.56.100:5555 device

$ adb shell
shell@android:/ $ exit
$ adb root
restarting adbd as root
$ adb shell
error: no devices/emulators found

I've done further research to understand how to make the file system writeable, but people say you have to have a rooted device to make it writeable

other findings were that the "su" doesn't work because your device has to be rooted for su to work

Essentially, it seems that you can't root your device unless it's rooted :headscratch:

please help
 

Rukbat

Retired Moderator
Feb 12, 2012
44,529
26
0
Visit site
Push su to sdcard. Then try to mv /sdcard/su /system/xbin.

Or try mounting the system on the installation CD in MacOS, then moving su to /system/xbin. (If MacOS respects the directory's read-only status, you may have to do it on a Windows PC.) Then write that fs back to the CD and install the emulator - which will have 'the SuperSU binary" (which is the su file).

The problem (and it's been a problem since Android) is that you can't mount /system/xbin for rw unless the "device" is rooted - which is what you're trying to accomplish. So for each version of Android, for each phone model, someone has to find a way of causing Linux to reboot as root temporarily, so that su can be moved to /system/xbin. Chainfire made it easy for a lot of devices with CF Root, but evidently no one's figured out how to get the emulator into a rooted state.
 

Forum statistics

Threads
943,148
Messages
6,917,520
Members
3,158,847
Latest member
fallingOutOfLoveWfithTech