Rooting ICS emulator; pushing su fails with "Out of memory"
Asked Answered
M

2

5

I'm trying to root my ICS AVD, and have tried this:

adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system  
adb push su /system/xbin/su  
adb shell chmod 06755 /system  
adb shell chmod 06755 /system/xbin/su

It fails with the following error:

failed to copy 'su' to '/system/xbin/su': Out of memory

How can I fix this?

Mavis answered 29/3, 2012 at 8:40 Comment(2)
Your title is way confusing. Afaik the emulator instance is always rooted. Please change your title to fit the question.Adele
I believe the emulator allows adb shell to be executed, but doesn't have the su executable installed.Electrophoresis
E
17

This blog explains the problem:

To avoid the "Out of memory" error when trying to copy the su-executable to /system/bin, you need to start the emulator manually with a large –partion-size argument:

$ emulator -avd MYNAME -partition-size 300

Then:

$ adb remount
$ adb push su /system/bin/su
$ adb shell chmod 06755 /system/bin/su

Note that MYNAME above is the name of the emulator. Also note that if you are using snapshots, you will need to start the emulator without it due to the change in hardware configuration. Append -no-snapshot-load to do so.

Electrophoresis answered 10/4, 2012 at 22:39 Comment(1)
This works in Windows. Be in the command prompt, in C:\adt\sdk\tools, or wherever your tools directory is. If you're in Explorer, you can shift+right click for an "open command prompt here" option.Therein
V
8

With this you'll have 512MB of size on /system

ICS is the name I gave to my android emulator:

android-sdk-linux/tools$ emulator -avd ICS -partition-size 512

Veinstone answered 3/4, 2012 at 7:20 Comment(2)
This is the correct answer and it came a week before the top-voted answer! Not formatted quite so pretty though.Dubai
Formatting has value, but even more: references (in this case to the blog) has high value, apparently more value than speed.Collegiate

© 2022 - 2024 — McMap. All rights reserved.