Android emulator ignoring configuration?

You must Login before you can answer or comment on any questions.

I have an AVD originally created by Titanium. I then used the AVD editor to change the size of the SD card to 16GB and cache partition. It took a long time to set up a 16GB SD card, and then it reported that it had successfully edited the AVD for me.

When I run the AVD and check the size of the SD card, it says 64MB. What am I doing wrong? I checked the config.ini file for the AVD, and it does report the correct settings.

System info: > Mac OS X 10.7.2, Intel Core i5 > Titanium Studio 1.0.6 > Titanium Mobile SDK 1.7.5 (also tested with 1.7.6 CI and 1.8.0 CI)

Relevant emulator settings (from config.ini): > sdcard.size=16G > disk.cachePartition.size=2048MB > hw.ramSize=1024

— asked 1 year ago by Stephen Tellis
1 Comment
  • I forgot to mention that I'm using Android 2.3.3 (API level 10)

    — commented 1 year ago by Stephen Tellis

2 Answers

Here is how to create a new sdcard and replace the titanium sdcard (for MAC),

Step 1 we create a new sdcard,

open terminal and paste this line:

/android-sdk-mac_x86/tools/mksdcard 1G /android-sdk-mac_x86/tools/newsdcard.sdcard

you need to change the path to your sdk path like this template:

mksdcard [-l label] <size> <file>

replace the <size> with your size, you can use 'K' for KiB, 'M' for MiB, or 'G' for GiB.

replace the <file> with your path to the new file and lunch.

Now it will create a new sdcard in your path,

Step 2, run over the old sdcard with the new sdcard my path to the old sdcard is:

/Users/[ME]/.titanium/titanium_3_HVGA.sdcard

you can see your path in titanium when you close the emulator and open it again, it appear in the console window like this:

[DEBUG] /android-sdk-mac_x86/tools/emulator -avd titanium_3_HVGA -port 5560 -sdcard /Users/[YOU]/.titanium/titanium_3_HVGA.sdcard -logcat *:d,* -no-boot-anim -partition-size 128

if you dont see it try delete the emulator and open it again.

after replace the files you can check the size of your sdcard from the emulator, go to menu>settings>sd card & phone storage>total space and that's all, hope that's help.

All right, so I discovered that in the builder.py script for Android, it is explicitly creating a 64MB .sdcard file for each AVD that it creates. It seems to be using that file as the SD card regardless of what you change in the Android SDK GUI tool.

— answered 1 year ago by Stephen Tellis
answer permalink
5 Comments
  • I came to the same conclusion - is this considered a bug? I would like to specify sdcard images and not have the builder.py script generating new sdcard files - patching builder.py with every new sdk release is certainly not such a big thing, but it´s not very elegant too... beeing able to configure this from TI Studio would be good!

    — commented 1 year ago by Winston Smith

  • It's not a bug. I also just edit the builder.py for every version of the SDK. It's a bit of a pain, but nothing too serious.

    Another thing you can do is to create a large .sdcard file using the AVD manager, and then keep a copy of it in a safe place. Then, you can just replace the .sdcard file created by Titanium by default with a copy of your large, blank .sdcard file. It's quicker than editing builder.py.

    — commented 1 year ago by Stephen Tellis

  • I do not understand how do you come to the conclusion that this is not a bug - of course it is! I need control over which AVD is used and which SDCard is used, as there are some more apps I want my app to play well with, that is why I need my own cards used. Currently the builder.py stubbornly overrides my prebuilt avd settings.

    — commented 1 year ago by Winston Smith

  • Show 2 more comments

Your Answer

Think you can help? Login to answer this question!