How to use Android Emulator to test custom ROMs

Search This thread
L

LastStandingDroid

Guest
Al Credits Goes TO Perceval from Hyrule

** Currently writing this, please wait !

Hello there,

here is a new tutorial I'm sure you'll like. As usual it took me LOTS of work to get all info and make this to work, so now I share it with you and show how to run custom ROMs within Android SDK Emulator.
Please note it's mainly for XPERIA X10, but process is the same for other Android-powered devices. It will show you the process for Linux.

1. Download the latest Android SDK.
2. Open the archive, and copy the folder android-sdk-linux-x86 to a safe place. You can also rename it to an easier name. Example : I placed it in ~/Home and renamed it androidsdk.
3. Go to the SDK folder, then in the folder Tools/. Double-click on Android and choose Run.
4. Go to Available packages, and choose to install (choose at your will !)
  • Android SDK Tools, revision 8
  • Android SDK Platform-tools, revision 1
  • SDK Platform Android {VERSION(S) YOU WANT} (!) You need at least one Platform. For X10, you can download 1.6, 2.1. You can also add 2.2, 2.3.
Once it's done, close the window.
5. Download Xperia X10 add-on for SDK. (?) Read the PDF add-on guide, it is helpful !
Copy the folder (from the archive) XPERIA-X10_r1 inside the folder add-ons of your Android SDK folder ({androidsdk}/add-ons/).
6. Run terminal, go to your Android SDK folder, then in tools folder, and run
Code:
./android list target
.
Note the id number of the Android you want to develop (ie for me, Android 2.3 is
Code:
id: 3 or "android-9"
). (?) You might also want to note the name ("android-X") as it might be useful later.
7. Now, create AVD (a profile for emulator). Usual command (assuming you are INSIDE the /tools/ folder !) is
Code:
android create avd -n NAMEYOUWANT -t {ID}
So, for us, it will be
Code:
./android create avd -n myx10 -t 3
8. To generate the AVD, you will be prompted several info. Type these for Xperia X10 :
  • Create custom hardware profile : yes
  • SD Card support : yes
  • Asbstracted LCD density : 160 (correct if I'm wrong ?)
  • DPad support : no (?)
  • Accelerometer : yes
  • Max camera pixels (H) : 3264
  • Cache partition size : 66 (?)
  • Audio playback : yes
  • Trackball : no (?)
  • Max cam pixels (V) : 2448
  • Camera support : yes
  • Battery support : yes
  • Touch screen : yes
  • Audio record : yes
  • GPS : yes
  • Cache partition : yes
  • Keyboard : no
  • heap size : 32
  • RAM : 280
  • GSM Modem : yes

(?) I recommend you to create one profile for each Android version you want to run (so : you just have to change the ID, and create same profile). If you don't, you won't be able to run custom ROMs using other versions of Android (ie your AVD profile is 2.3 and you run a 2.1 custom ROM).

9. Done ! Take your custom ROM (downloaded, compiled... In this case, files are in {YourAndroidRepoFolder}/out/target/product/generic/. It comes with about 3 files, including a file called system.img. Copy this file into the folder (hidden) .android/myx10{In fact, the name you've chosen earlier "NAMEYOUWANT"}.avd/
10. Run terminal, go to Android SDK folder/tools/ (if you didn't close your current terminal, you're already in :) and run this command to run emulator WITH your custom ROM :
Code:
./emulator -avd myx10{again the "NAMEYOUWANT" you've chosen before}
Wait and enjoy !

(?) First boot is long - it's NORMAL. Just like on a real device, the OS will be cached and will work faster and faster.
 

Megalith27

Senior Member
Feb 17, 2012
549
277
Baku
Great tutorial but the point that confuses me is: If we're creating AVD why do we need and where/how do we used device add-on for SDK?
 

mrdoc151

Senior Member
Sep 13, 2010
181
29
NYC
there is a new version of ADT out since this tutorial was written. I am able to run a virtual machine but how can I get a custom rom on it? Please help.
thanks
 

OzoGaming

New member
Apr 23, 2017
1
0
2. Open the archive, and copy the folder android-sdk-linux-x86 to a safe place. You can also rename it to an easier name. Example : I placed it in ~/Home and renamed it androidsdk.

* I can't see any archive. :rolleyes:
 

Mainak007

Senior Member
Nov 29, 2016
58
8
Can you please make a video tutorial? I don't have terminal i use Windows

Download cygwin from HERE ;)
It should help you :cool::cowboy:

---------- Post added at 06:34 AM ---------- Previous post was at 06:29 AM ----------

2. Open the archive, and copy the folder android-sdk-linux-x86 to a safe place. You can also rename it to an easier name. Example : I placed it in ~/Home and renamed it androidsdk.

* I can't see any archive. :rolleyes:

Here the archive means the flashable custom rom ;);):laugh::D
 
  • Like
Reactions: Frannq123 and Fstop

Mainak007

Senior Member
Nov 29, 2016
58
8
Need a windows tutorial.....

This tutorial looks like for linux......please make a windows version tutorial :confused:
:rolleyes::rolleyes::(
 

diegogerx1

Member
Apr 29, 2007
8
0
Black Screen here, any suggestion?

I saw that the ramdisk.img is also needed, but I dont know how to generate it
 

Fstop

Senior Member
Apr 18, 2015
122
12
You can use fastboot / ADB to pull ramdisk.img for the device brand model you are trying to cook for. Tutorial on youtube- I have to watch it again guy is not a natural instructor - oh well grateful for the seeds and the few Linux tutorials: I want to try setup a profile for Doogee Mix due to little support for it. Think its worthy of a few custom options. [email protected] 'LastStandingDroid" Thank U - I was looking for how to unpack stockmix.rar to fastboot flash for a restore, Can I use those same basic files to create a skeleton profile for custom rom? I'm just frankensteining
 
Last edited:

Top Liked Posts