Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android emulator system partition no space from start

Tags:

I have a weird problem with the Android emulator. I have created a virtual device through Android AVD manager (newly created emulator with platform 2.1 and API level 7). I have tried with standard settings and with added hardware parameter for larger (256 MB) device RAM size but nothing changed.

I need to come files to the system partition to test a project (called haggle), but for some reason the system partition has no space from start.

aa a@aaa /home/haggle-0.2-android
$ adb -s emulator-5554 shell

 # df
df
/dev: 47084K total, 0K used, 47084K available (block size 4096)
/sqlite_stmt_journals: 4096K total, 0K used, 4096K available (block size 4096)
/system: 73600K total, 73600K used, 0K available (block size 4096)
/data: 65536K total, 18464K used, 47072K available (block size 4096)
/cache: 65536K total, 1156K used, 64380K available (block size 4096)

As you can see the system partition has 0K space available. When a connect a non-rooted HTC Nexus One and do the same I get these values:

/dev: 108896K total, 0K used, 108896K available (block size 4096)
/sqlite_stmt_journals: 4096K total, 0K used, 4096K available (block size 4096)
/system: 148480K total, 116364K used, 32116K available (block size 4096)
/data: 200960K total, 22296K used, 178664K available (block size 4096)
/cache: 97280K total, 1852K used, 95428K available (block size 4096)
/sdcard: 3864064K total, 118496K used, 3745568K available (block size 32768)

Why does the system partition on the emulator have 0K free space from beginning, and what can I do to change that? Even if I make the partition write-able with mount/remount I get the same 0K values.

Any tips?

like image 407
Svullo Avatar asked Apr 20 '10 13:04

Svullo


People also ask

How do I free up space on my emulator?

Click Tools -> AVD Manager. Click the edit icon for the emulator. Click the Show Advanced Settings. Under Memory and Storage, reduce the Internal Storage, specify something like 2048MB for an emulator that comes with Google Play store or less for emulators without the Google Play Store.

How do I make more space on my Android Emulator?

On Android StudioClick Edit Icon to edit the AVD. Click Show Advanced settings. Change the Internal Storage, Ram, SD Card size as necessary. Click Finish.

How do I clean my Android Emulator?

The easiest way is just to launch the emulator, go to settings -> applications . Then pick the unwanted applications and uninstall them. Alternatively you can do adb -e shell while the emulator is running, find the . apk files in the file system (I think they're under /system/apps) and remove them manually.


2 Answers

Found the answer :)

When starting the emulator you can specify the partition size by -partition-size x emulator_name.

done through the terminal that is. Example:

emulator -partition-size 125 @AVD1

OR

emulator -partition-size 125 -avd AVD1

Note that the size must be bigger than your current system partition size. For the Android4.0.3 emulator the default size is already 168 so set your new partition-size to something bigger like 256

like image 113
Svullo Avatar answered Oct 02 '22 08:10

Svullo


Nowadays, -partition-size changes the /system/data partition, but not the /system partition space.

If you want to install the full GApps, for example, you will need more space.

The general procedure to do so in Unix is documented at https://unix.stackexchange.com/questions/104790/how-to-setup-a-growable-loopback-device

In short:

  1. Make a copy of system.img so that you don't modify the original one in the SDK (cp system.img system-extended.img)
  2. Grow your system-extended.img to your desired size (e.g., truncate system-extended.img -s 2G)
  3. Resize the inner ext4 filesystem (resizefs system-extended.img OR resize2fs system-extended.img)
  4. Use the new img file when calling the emulator via the -system <path/to/system-extended.img> parameter. The -writable-system parameter may also come in handy for you.
like image 41
ssice Avatar answered Oct 02 '22 10:10

ssice