FORUMS
Remove All Ads from XDA

How to use Android Emulator to test custom ROMs

n/a posts
Thanks Meter: 0
 
By LastStandingDroid, Guest on 14th April 2012, 11:05 AM
Post Reply Email Thread
Al Credits Goes TO Perceval from Hyrule

Quote:
Originally Posted by 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.

The Following 21 Users Say Thank You to LastStandingDroid For This Useful Post: [ View ] Gift LastStandingDroid Ad-Free
 
 
1st June 2012, 06:22 PM |#2  
TodorSRB's Avatar
Senior Member
Thanks Meter: 175
 
More
Can you please make a video tutorial? I don't have terminal i use Windows
The Following 2 Users Say Thank You to TodorSRB For This Useful Post: [ View ] Gift TodorSRB Ad-Free
3rd September 2012, 01:57 AM |#3  
Senior Member
Flag Winchester
Thanks Meter: 215
 
Donate to Me
More
Thumbs up terminal on windows
Quote:
Originally Posted by TodorSRB

Can you please make a video tutorial? I don't have terminal i use Windows

in windows 7, press the start button, type in cmd, hit enter and viola! you are in a terminal
The Following User Says Thank You to jacobmacek For This Useful Post: [ View ] Gift jacobmacek Ad-Free
31st October 2012, 08:06 PM |#4  
Megalith27's Avatar
Senior Member
Flag Baku
Thanks Meter: 278
 
Donate to Me
More
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?
26th November 2012, 07:31 PM |#5  
kingayazkhan's Avatar
Junior Member
Flag Matli
Thanks Meter: 3
 
More
Post Thanks
Quote:
Originally Posted by LastStandingDroid

Al Credits Goes TO Perceval from Hyrule

thanks
The Following User Says Thank You to kingayazkhan For This Useful Post: [ View ] Gift kingayazkhan Ad-Free
15th April 2013, 10:02 PM |#7  
Senior Member
NYC
Thanks Meter: 28
 
Donate to Me
More
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
7th July 2013, 03:17 PM |#8  
Stryke_the_Orc's Avatar
Retired Senior Moderator
Flag Maras Dantia
Thanks Meter: 9,175
 
More
Quote:
Originally Posted by mrdoc151

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

You need to download more than one api, it creates the directory for addons and continue from there :beer:
31st July 2013, 08:13 PM |#9  
Senior Member
Thanks Meter: 11
 
More
thanks for the tutorial

A question, ¿how to compile a rom? :S
5th August 2013, 04:27 AM |#10  
Stryke_the_Orc's Avatar
Retired Senior Moderator
Flag Maras Dantia
Thanks Meter: 9,175
 
More
Quote:
Originally Posted by jomigp01

thanks for the tutorial

A question, ¿how to compile a rom? :S

A Linux environment is best, and there are a million tutorials all over xda:beer:

Slithering from the nether regions of a twisted mind and tarnished soul
30th January 2014, 04:30 PM |#11  
ajster1989's Avatar
Senior Member
Flag NYC
Thanks Meter: 387
 
Donate to Me
More
Quote:
Originally Posted by jacobmacek

in windows 7, press the start button, type in cmd, hit enter and viola! you are in a terminal

That is not terminal. If you need terminal in windows download CYGWIN. http://www.redhat.com/services/custom/cygwin/
The Following 2 Users Say Thank You to ajster1989 For This Useful Post: [ View ] Gift ajster1989 Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread