2

I am trying to run a emulator from the Android source by loading the goldfish kernel with some of my configuration changes. Though I found a lot of questions on this, but could not find my answer. 1. I downloaded the android source. 2. I also successfully built my goldfish kernel. Now I can see the zImage in the /goldfish/arch/arm/boot folder. After this I tried running this emulator by referring to a lot of similar questions. Building Android from source - emulator and AVDs, Running emulator after building Android from source, How to compile android goldfish 3.4 kernel and run on emulator. But unfortunately didn't solve my problem. When I try to run the emulator with :

./emulator -debug init -kernel Thepath/goldfish/arch/arm/boot/zImage -avd firstAvd -wipe-data

I get an error that AVD is not found. I then found this blog, https://yaapb.wordpress.com/2012/09/22/build-a-custom-android-emulator-image/ where it says to first make the emulator from the source tree by the following commands:

$ source build/envsetup.sh
$ lunch full-eng
$ make -j4
$ emulator -wipe-data &

Then to run the emulator with my modified kernel, I need to run :

$ cd ${ANDROID_BUILD_TOP}
$ emulator -kernel ~/workspace/android/goldfish/arch/arm/boot/zImage -wipe-data &

Though I am trying to do this, the process of creating the emulator with the make command is taking hours. 7% in 90 mins till now. So in the mean time I wanted to know if anyone can tell me that to run an emulator with my kernel, do I need to first create an emulator from the source? Also, I dont find the system.img, ramdisk.img files in the android source tree. Is it normal or I ge them when I create an emulator?

**

EDIT

** I would also like to know if I can run the emulator without the make -j4. The Android source tree also includes the SDK. Can I run the Emulator from the SDK. If yes, how? The google official docs say to run the following command form the /tools folder in the sdk. But there is no tools folder in the sdk folder.

Community
  • 1
  • 1
ankur
  • 43
  • 6

1 Answers1

0

After you have built the sources, you should not run build process once again in order to use the emulator. Simply go to the folder with your AOSP code and run the following commands:

$ cd ${ANDROID_BUILD_TOP}
$ source build/envsetup.sh
$ emulator -kernel ~/workspace/android/goldfish/arch/arm/boot/zImage -wipe-data &

The command source build/envsetup.sh will add additional commands to your shell, and you should be able to run emulator without building it one more time from scratch.

Yury
  • 20,618
  • 7
  • 58
  • 86