Android - How to solve: "Failed to push selection: Out of memory"
Launch the emulator from the command line so that you can specify a /system
partition size using the -partition-size <MB>
option. For example, I use this to launch an emulator running Android 1.6 with a /system
partition of 512 MB:
emulator -avd Donut -partition-size 512
...where "Donut" is whatever you named your AVD (you can check in Eclipse's AVD manager if you need to). The emulator
binary should be in your tools/
directory within your SDK install, which for you appears to be C:\android\android-sdk-windows\tools
, so be sure you cd
into that directory first (or add it to your system's %Path%
).
Eclipse may not pick up the emulator right away, or it may recognize it and then drop the connection. If either of those happens, click the view menu on the Devices tab (the little arrow next to the minimize button) and select "Reset adb" to get the connection back.
Once it shows up in your devices, do what you were trying to do earlier. Run adb remount
to get the /system
partition in read-write mode, then use Eclipse to push the file wherever you want. I tested with a couple of random files a minute ago and was able to push them to /system/xbin
without any trouble.
For reference, here's the partition size and use of /system
on my Donut emulator when I specify a 512 MB partition:
> adb shell df
...
/system: 508416K total, 61332K used, 447084K available (block size 4096)
...
But here's how it looks if I launch without specifying a size:
> adb shell df
...
/system: 65536K total, 61204K used, 4332K available (block size 4096)
...
Additionally, you can set command line options in your application's run configuration via Eclipse if you want to. Go into your Java perspective, then select Run->Run Configurations
from the menu bar. Select your application in the left pane, and then pick the "Target" tab. At the bottom is a text box labeled "Additional Emulator Command Line Options", and you can add -partition-size <MBs>
to that text box so that the emulator launched when you run your application will have a larger /system
partition.
Note: You may have to add also -no-snapstorage
or other options, to disable loading the existing snaphot, to the command line. It did not work without it for me.