How to launch emulator from the built source?

830 views
Skip to first unread message

rams

unread,
Dec 23, 2008, 9:47:50 AM12/23/08
to android-porting
Hi All,

I have downloaded the Android Sources using the repo tool.
Built the image. Now I have the following files in the folder
"/myandroid/out/target/product/generic/"
1) ramdisk.img
2) userdata.img
3) system.img
4) userdata-qemu.img.

Where & How to launch the emulator using these binaries?
Please tell me how to use goldfish.

Thank you,
Ram.

Android Zaurus

unread,
Dec 23, 2008, 7:25:36 PM12/23/08
to android-porting
Hi,

A couple of ways you can try;

1) "make sdk" and you will get your own SDK.
2) Download SDK and replace img files with your build.

Cheers,

Landswipe

unread,
Dec 25, 2008, 7:54:58 AM12/25/08
to android-porting
I run it like this :-

# out/host/linux-x86/bin/emulator -system out/target/product/generic -
kernel prebuilt/android-arm/kernel/kernel-qemu

I'm not sure if this is the correct method, but it works :)

Andriod Developer

unread,
Dec 29, 2008, 5:42:49 PM12/29/08
to android-porting
I tried "make sdk" it fails. Did anybody try this?

On Dec 23, 4:25 pm, Android Zaurus <androidzau...@yahoo.co.jp> wrote:
> Hi,
>
> A couple of ways you can try;
>
> 1) "makesdk" and you will get your ownSDK.
> 2) DownloadSDKand replace img files with your build.

mark lee

unread,
Dec 30, 2008, 10:12:09 PM12/30/08
to android...@googlegroups.com
Acctually, after you build the Android source with "make", the emulator is built out at
./android/out/host/linux-x86/bin, if has setup the PATH of  three *.img and kernel path, the emulator can work well. 

--- 08年12月30日,周二, Andriod Developer <andrd...@gmail.com> 写道:
发件人: Andriod Developer <andrd...@gmail.com>
主题: [android-porting] Re: How to launch emulator from the built source?
收件人: "android-porting" <android...@googlegroups.com>
日期: 2008,1230,周二,6:42上午


好玩贺卡等你发,邮箱贺卡全新上线!

jasperr

unread,
Jan 2, 2009, 7:18:20 AM1/2/09
to android-porting
I've tried the emulator I built under "./android/out/host/linux-x86/
bin", the mobile GUI pops out but keeps black screen, without
"android_" appearing on the screen.
I downloaded android SDK before. So I also tried to copy the three
*.img to "android-sdk-linux_x86-1.0_r1/tools/lib/images" and use the
emulator from the SDK, the same problem happened. But if I use the
original 3 images in the SDK, everything is OK.

So it seems the 3 images I built can not work with the emulator.
I built the image with the following config:
TARGET_SIMULATOR: false
TARGET_BUILD_TYPE: release
TARGET_PRODUCT: generic ---- (I did not choose "emulator, is
this the root cause?)

Shall I choose "emulator" as the target product?
Thanks a lot!

Jasperr

jasperr

unread,
Jan 2, 2009, 7:26:57 AM1/2/09
to android-porting
But when I choose " TARGET_PRODUCT: emulator"
and make, the building fails with the error:
build/core/product_config.mk:161: *** No matches for product
"emulator". Stop.

Does somebody meet the same problem?

Best Regards
Jasperr

rams

unread,
Jan 2, 2009, 7:35:21 AM1/2/09
to android...@googlegroups.com
Hi Jasper,

Try this: (Its working for me)

1) . build/envsetup.sh
2) choosecombo [1, 1, 2, then default option]
3) make

You should see the following when make is going on:
====================
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=
====================

Thats it. Good Luck!

Ram

2009/1/2 jasperr <mengdo...@hotmail.com>

jasperr

unread,
Jan 2, 2009, 8:21:12 AM1/2/09
to android-porting
Thank you, Ram!

I made the same choices of "choosecombo" as you suggested.
And I found why the emulator "does not" work previously:
I did not wait for enough time! It seems it takes the emulator longer
for the 1st boot up when using a new image.
When I left for ten minutes and came back to my computer, I found it
boots up successfully.

Best Regards
Jasperr

jasperr

unread,
Jan 2, 2009, 9:51:53 AM1/2/09
to android-porting
I was happy too early. The emulator built from source still can not
work : the mobile screen keeps black and "adb shell" said "error:
device not found".
Here is my configuration for make:
=====================================
TARGET_PRODUCT=generic
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_OS=linux
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=TC3
======================================

And there is a strange thing for me:
I modified the video player in the api demo, then ran "make". Under
out/target/product/generic, I saw both "system.img" and
"userdata.img"
are updated. Then I run the emulator from the downloaded SDK, which
can bootup successfully. I did not copy the 3 images I built to SDK
"tools/lib/images". I found
1. it uses the "userdata.img" I built
because my changes to the api demo make effect. I also use "adb
shell" to check the "data/app" and "data/dalvik-cache" of the device,
I saw both "ApiDemos.apk" and "data@app@ApiDem...@classes.dex"
are updated.

2. but does not use the "system.img" I built, but still use the one
with the SDK.
I check "system/lib" on the device and saw some shared libraries'
name are for the emulator (libpv*.so), not as the one under "/system/
lib" built from the source (libopencore*.so).


I wonder Is there any difference between the emulator from the SDK and
that built from source? So the system image are not switchable?
I saw there is a file "kernel-qemu" from the SDK, but no such a file
built out from the source.

Is it enough only type "emulator" to run the emulator built from
source?


Thanks
Jasperr

rams

unread,
Jan 2, 2009, 10:03:42 AM1/2/09
to android...@googlegroups.com
Jasper,

Please do one thing buddy. Try the above settings as I have mentioned.
You need not copy the images to your SDK. Keep your SDK
separate. Its not at all needed. You rename your SDK
emulator binary to emulator_1 to avoid confusion and also for
checking whether your built emulator works. First try making
the clean sources work perfectly and add changes one by one.

Thanks
Ram.

2009/1/2 jasperr <mengdo...@hotmail.com>

jasperr

unread,
Jan 5, 2009, 3:39:47 AM1/5/09
to android-porting
It seems the problem is that the emulator can not use the "system.img"
I built.
And it's the "system.img" that cause the trouble.

I modified "linux-arm.mk" before I ran "make". I changed the arm arch
version from "armv5te" to "armv6j". I think that's why my code can run
on the target board but the emulator can not suppport it.

Thanks
Jasperr

Jean-Baptiste Queru

unread,
Jan 5, 2009, 3:51:02 AM1/5/09
to android...@googlegroups.com
If I remember correctly the current emulator does not emulate all
ARMv6 instructions. I might be wrong.

JBQ
--
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

David Turner

unread,
Jan 5, 2009, 12:13:09 PM1/5/09
to android...@googlegroups.com
The emulator doesn't emulate *any* ARMv6 instruction at the moment (ARMv5TE max)

2009/1/5 Jean-Baptiste Queru <j...@google.com>
Reply all
Reply to author
Forward
0 new messages