Android-x86 vs SDK Emulator for App Development and Testing

456 views
Skip to first unread message

Nick

unread,
Jun 21, 2012, 10:46:23 AM6/21/12
to andro...@googlegroups.com
I am working in an environment where using physical devices isn't really an option.  I am looking for the best (or perhaps, just a good) method for performance testing (and developing) apps.  Really, I'm looking for a broad PC-based platform to evaluate apps before deploying them.
 
Two ways of doing this jump out at me:
 
1) Android-x86. 
 
Pros: provides a native environment, portable, and easy to setup
Cons: cannot run apps that have ARM only code - which there are many of
 
2) Android's SDK Emulator
 
Pros: can run native apps (supported by Android version)
Cons: terribly slow, and not very portable, potentially more difficult to track app performance
 
Clearly, since I am on the Android-x86 group there should be a bias toward Androd-x86.  I was just wondering if anyone could offer their thoughts on the options I've outlined.  Any additional comments are greatly welcomed.
 
Nick

Chih-Wei Huang

unread,
Jun 21, 2012, 9:34:33 PM6/21/12
to andro...@googlegroups.com
2012/6/21 Nick <nickse...@gmail.com>:
> I am working in an environment where using physical devices isn't really an
> option.  I am looking for the best (or perhaps, just a good) method for
> performance testing (and developing) apps.  Really, I'm looking for a broad
> PC-based platform to evaluate apps before deploying them.
>
> Two ways of doing this jump out at me:
>
> 1) Android-x86.
>
> Pros: provides a native environment, portable, and easy to setup
> Cons: cannot run apps that have ARM only code - which there are many of

The cons may have a solution now.
Search the posts about "arm translator" in the forum.


> 2) Android's SDK Emulator
>
> Pros: can run native apps (supported by Android version)
> Cons: terribly slow, and not very portable, potentially more difficult to
> track app performance
>
> Clearly, since I am on the Android-x86 group there should be a bias toward
> Androd-x86.  I was just wondering if anyone could offer their thoughts on
> the options I've outlined.  Any additional comments are greatly welcomed.


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Nick

unread,
Jun 22, 2012, 1:46:20 PM6/22/12
to andro...@googlegroups.com
Very nice, when I had last read the ARM translator thread I was under the impression that the Bluestacks and Intel translators were not open source, but it now looks like at least the Bluestacks translator is.  In which case, Android-x86 is a much more attractive option to use than the SDK emulator.
 
Now I do realize that this is a loaded question, but are there any obvious reasons why Android-x86 would not serve well for a performance testing platform?   Off the top of my head, the only outstanding advantage that the SDK emulator has over Android-x86 is that it is very easy to test different versions of Android.  Sure, this can be done with Android-x86, but only if there is an ISO (or you can make an ISO) compatible with the underlying hardware of whatever device you intend to use it on.
 
Am I making a fair comparison there?

Holger Schurig

unread,
Jun 25, 2012, 3:28:26 AM6/25/12
to andro...@googlegroups.com
You don't really need an ISO with Android-X86. In fact, I make my own image and boot directly into Android, even without an initrd (I *HATE* initrd, they are needed for nothing on an embedded device where you know your hardware and just eat booting time).

Here is how I make my image/ directory:

.PHONY:: image
image:
@test `id -u` = 0 || { echo "\n---> You need to run this as root\n"; exit 1; }
rm -rf image
mkdir image
@# Create all entries in the root directory
install -d -m 0755                      image/acct
install -d -m 0755                      image/boot
install -d -m 0770 -o 1000 -g 2001      image/cache
install -d -m 0500                      image/config
ln -s sys/kernel/debug                  image/d
install -d -m 0771 -o 1000 -g 1000      image/data
install -m 644 $(OUT)/root/default.prop image/default.prop
install -d -m 0755                      image/dev
ln -s system/etc                        image/etc
install -m 0750 $(OUT)/root/init        image/init
install -m 0700 init.rc                 image/init.rc
ln -s system/lib                        image/lib
install -d -m 0775         -g 1000      image/mnt
install -d -m 0555                      image/proc
install -d -m 0750                      image/sbin
ln -s mnt/sdcard                        image/sdcard
install -d -m 0755                      image/sys
install -d -m 0755                      image/system
install -m 0644 $(OUT)/root/ueventd.rc  image/ueventd.rc
ln -s system/vendor                     image/vendor

rsync -a $(OUT)/system/ image/system/

@# populate subdirectories
cp $(OUT)/kernel                        image/boot/vmlinuz
install -d -m 0770 -o 1000 -g 2001      image/cache/recovery
install -m 0700 modules.sh              image/etc/modules.sh
@# TODO /etc/camera.cfg
install -d -m 0700                      image/mnt/secure
install -d -m 0700                      image/mnt/secure/staging
install -d -m 0700                      image/mnt/secure/asec
install -d -m 0700         -g 1000      image/mnt/asec
install -d -m 0700         -g 1000      image/mnt/obb
install -d -m 0000         -g 1015      image/mnt/sdcard
install -d -m 0000 -o 1000 -g 1000      image/mnt/USB
install -m 0750 $(OUT)/root/sbin/adbd   image/sbin/adbd
install -m 0750 $(OUT)/root/sbin/v86d   image/sbin/v86d
ln -s ../init                           image/sbin/ueventd

@# use some busybox tools
mv image/system/bin/ls                  image/system/bin/ls_toolbox

I also have code to create my own "hda" image file, partition it, format it, rsync the image/ directory into it and make it bootable. I also now have android running on my target device, and can rsync image/ directly onto the target. No ISO image needed, much faster that way.

Please also note that I have my own init.rc, that knows about my directory structure. For example, I removed many of the create-stuff from the init.rc file into my Makefile, e.g. "mkdir /mnt 0755 root system", "symlink mnt/sdcard /sdcard" and so on. No need to re-do this at every boot when I can do this once at image-creation time.

Nick

unread,
Jun 26, 2012, 8:23:48 AM6/26/12
to andro...@googlegroups.com
I think I am a little confused with some wording here.  The images you make, they are not ISOs.  Are they just the built kernel/filesystem then, or am I missing something?
 
This seems like a very practical approach, becuase it would allow customization of a build for my hardware.  I will have to study what you posted as I am not familiar with the install command.
 
Thanks for the tip!

Holger Schurig

unread,
Jun 26, 2012, 10:22:49 AM6/26/12
to andro...@googlegroups.com
ISO images are nice for testing something on a device. But to use android permanently, you'd better install it on some hard disk (or usb stick, or compact flash etc). The ISO that the android-x86 project provides contains an installer, selectable in grub's bootmenu. If that works for you: fine.

My makefile excerpt is a different installer, so to say. It's very fast to adapt to local needs, compared to the clumsy process of making a new iso, booting that iso, checking things out ...   and no, my makefile excerpt doesn't generate an ISO.

However, if you don't know low-level linux things or development things (like makefiles), then please stay away from what I've posted. OR learn, e.g. using the "man" command.

I'm using "install" instead of "cp" because that way I can specify the mode, user and group ownership of the newly copied file.

Nick

unread,
Jun 26, 2012, 1:01:10 PM6/26/12
to andro...@googlegroups.com
Thanks for the information!!
 
I'm actually farily comfortable with makefiles.  While I haven't worked with makefiles on the scale seen in Linux development, I grasp the basics well enough.
 
I will have to consider your approach as I think that it could be a way for me to speed up my work.  However, like you said, I will need to learn.
 
Thanks again!
Reply all
Reply to author
Forward
0 new messages