Emulator Roms

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Emulator Roms

Postby blundell » Wed Jun 23, 2010 10:39 am

Sorry if this has already been covered.

I was just interested is it possible to get a 'rom' to emulate each different phone i.e. an emulator for the motorola droid / nexus one / htc desire?

This is obviously a cheaper option than me buying one of each phone!!

User avatar
Master Developer
Master Developer
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK


Re: Emulator Roms

Postby dynfeisu » Thu Jun 24, 2010 12:27 am

How ever I've managed to run custom rom on emulator.but some problems occurred .
to make emulator run custom rom we have to replace some boot files.
The problem is the emulator do not have boot.img so that we have to split it into 2files. I use a perl script called split_bootimg.pl to make it. it has boot.img-ramdisk.gz and boot.img-kernel as output .
if I only rename boot.img-ramdisk.gz to ramdisk.img and replace the old one in platforms\android-7\images. and replace the custom system.img the emulator running but without services. I cannot get access to internet etc. and we cannot use adb command .when using. return something like device not found.
but if I rename boot.img-kernel to kernel-qemu. the emulator wont even startup and show up. what's the problem? can I just use the old emulator kernel? anything different from the custom rom's boot.img's kernel?and is there anyway to make the custom rom fully working with service? with the official sdk rom and ramdisk.img. when I startup the system. I have a 3g icon over the top and have signal.but now I dont have. anyone know a solution for this? Thank you.

Hope the hint above can help u run your rom.but no yet a prefer solution.because you cannot do anything adb command and no network access. Perhaps you can find a way to fix it.Please tell me when you done:)
Posts: 2
Joined: Thu Jun 24, 2010 12:21 am

Re: Emulator Roms

Postby 3dmt » Sun Jul 11, 2010 1:22 pm

I'm very interested in getting ROMs working in the Emulator. I just found this and will try it out shortly. It involves creating a system.img using the mkfs.yaffs2 tool. Basically, it uses the Android OS (emulator) itself to run the tool that then converts zipped roms into a system.img file -- which can then be used in the emulator.

Please post any sucesses! I need to get the N1 2.2 rom working so I can figure out why our app is crashing in 2.2 on certain devices -- works fine in the emulator.

Good luck!

Here's an example of how to use a system.img in the emulator:

From: http://android.modaco.com/content-page/ ... c/page/20/

This is the right way to use the JacxHero system.img on the emulator:

emulator.exe -avd jacxhero -system system.img -partition-size 150 -sdcard sdcard

previously you have to create an avd named jacxhero and also create a sdcard using mksdcard.exe

Making a system.img

From http://forum.xda-developers.com/archive ... 25930.html

The google android emulator included in the google android sdk is limited. Although you can use 'adb push' to upload more tools, but one has to do it again next time. Follow the steps to create a enhanced system.img:

1. system.img is yaffs2 flash file system, so firstly you need the mkfs.yaffs2 tool, download it in the following link: Release Android Yaffs2 Tool (Both X86 And ARM) (http://openhandsetalliance.org.cn/bbs/v ... a=page%3D1). One has to be a registered user to download the tools.
2. use the 'adb push' to upload tools to android emulator, executables in /system/bin/, libraries in /system/lib, one can also create folder. One need change the file mode necessary.
3. upload the ARM mkfs.yaffs2 tool, use the following command to create system.img: # mkfs.yaffs2 /system /system.img
4. download the system.img to local with command 'adb pull', replace the system.img in your emulator folder/tools/lib/images/

so it seems like it would be just as much fun doing a nandroid backup


so now the real question is, how do we go about ripping out the nandroid functionality to be able to do this locally?

*edit 2*

it is the mkfs.yaffs2 tool

mkfs.yaffs2 yourdir yourimage

NANDROID - CYGWIN DIRECTIONS (not not not, I repeat, not fully tested and verified yet)

Changes so far if you are using cygwin:

1) Make sure you have the 'netcat' and 'gcc' packages, else just run cygwin.exe again and get them.
You can test if you have them by running 'which nc' and 'which gcc', both commands should return /usr/bin/<command>

2) Compile the mkyaffs2image executable.
Inside the extracted nandroid archive directory, goto the tartools\yaffs2\utils\ directory (inside a cygwin prompt) and type 'make'.
This should generate a file named "mkyaffs2image.exe" which you need to place somewhere on your path.
(Hint: If you haven't downloaded the Android SDK, abort now. Wait for more explicit directions... Else, place the .exe where adb is, since it should be on your path already)

3) Edit the nandroid.sh script. (else you get a permission denied error when the script tries to run the dump_image-arm file)
Find the line:
adb push ./$tool /cache/$tool
Add the following line after it:
adb shell chmod 777 /cache/$tool

4) Make a managed mount named /tmp (else windows will puke on the long unix filenames with colons, etc)
mkdir /tmp
mount -o managed c:/cygwin/tmp /tmp (Note: change c:/cygwin to be the directory cygwin was installed to, you can find it by typing 'cd /' and then 'explorer .')

5) Follow the standard "tar + mkyaffs2image" directions to generate the last three .img files. They refer to the /tmp directory which you created in the previous step.

Viola! Looks like I have a complete backup image now...
$ ls -l
total 117504
-rw-r--r-- 1 Osaka None 2621440 Jun 12 21:31 boot.img
-rw------- 1 Osaka None 737088 Jun 12 22:07 cache.img
-rw------- 1 Osaka None 53570880 Jun 12 22:06 data.img
-rw-r--r-- 1 Osaka None 262144 Jun 12 21:31 misc.img
-rw-r--r-- 1 Osaka None 5242880 Jun 12 21:31 recovery.img
-rw------- 1 Osaka None 57885696 Jun 12 22:06 system.img

Now I just need to drink up the courage to test it on my phone!
Posts: 2
Joined: Sun Jul 11, 2010 1:07 pm

Re: Emulator Roms

Postby 3dmt » Sun Jul 11, 2010 1:25 pm

Here's a link to download yaff2 tool (arm):
http://virgo81.tistory.com/attachment/c ... 80BE74.arm
Posts: 2
Joined: Sun Jul 11, 2010 1:07 pm


Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 2 guests