Running the Android emulator on 64-bit Fedora 12
From Crashcourse Wiki
As a first step in working with Android on Fedora, it's worth getting the Android emulator to run on Fedora 12. First, install the necessary 32-bit packages (which will pull in a number of appropriate dependencies):
# yum install libstdc++.i686 libX11-devel.i686 libXrandr.i686
Next, download the Android SDK tarball from [here], and unload it in a convenient non-root directory. Eventually, if things work out, you'll probably want to add the resulting tools sub-directory to your search path, but you can live without doing that for now.
At this point, cd into the SDK directory and run tools/android to configure and create your first Android Virtual Device.
First, it appears that you need to go to "Settings" and set the "Force https:// ..." setting. I tried without that and couldn't download. So select it, then "Save and Apply."
Next, go to "Installed Packages", select "Update All" and select the components for just those versions of Android you want to work with. Because I want to keep it simple and work only with the latest version, I chose to install only the two selections:
- SDK Platform Android 2.1
- Documentation for Android
so select "Reject" for everything else, then "Install Accepted". (As an aside, at this point, you should now have a directory ~/.android keeping track of some of your setting selections. Check it out if you want.)
Now it's time to create your first Android Virtual Device (AVD). Go to "Virtual Devices", select "New" and build a device. For test purposes, I selected values that allegedly correspond to a Motorola Droid:
* Name: "droid" * Target: Android 2.1 - API Level 7 * Size: 512MiB * Skin: WVGA854
and "Create AVD".
Finally, once it's created, you can try to "Start" it, at which point, if you're like me, it will fail quietly, and this is where the command line comes in handy.
You can equivalently launch your new AVD from the command line with:
$ tools/emulator -avd droid Segmentation fault $
Fine, let's just trace it to find the problem:
$ strace tools/emulator -avd droid
... snip ...
stat64("/dev/sound", 0xffaef4a4) = -1 ENOENT (No such file or directory)
open("/dev/dsp", O_WRONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
stat64("/dev/dsp1", 0xffaef4a4) = -1 ENOENT (No such file or directory)
stat64("/dev/sound", 0xffaef494) = -1 ENOENT (No such file or directory)
open("/dev/dsp", O_RDWR|O_NONBLOCK) = -1 ENOENT (No such file or directory)
stat64("/dev/dsp1", 0xffaef494) = -1 ENOENT (No such file or directory)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault
$
Clearly, something related to sound is causing us grief so let's just skip sound for now with:
$ tools/emulator -noaudio -avd droid
and there we have it -- a running Android emulator. If you want to see the command line options, just:
$ tools/emulator -help
One option I found handy was -scale .5 since the original emulator window was too large to fit on my display and there was no obvious way to drag to resize.
I'll address the sound issue shortly. Feedback can be sent to rpjday@crashcourse.ca.
Return to Android on 64-bit Fedora 12.

