Reputation: 1528
I've been modifying/editing parts of the Android platform, but have run into a problem when trying to test my edits. After making my changes to the platform source, I was able to successfully compile the source - thus creating system.img, ramdisk.img, and userdata.img.
When I go to test this in the emulator, the emulator just hangs on the "ANDROID_" screen, with the underscore blinking, but never seems to load. Any suggestions?
The command I used to run the emulator is as follows:
./emulator -system $HOME/android/platform/out/target/product/generic/system.img -ramdisk $HOME/android/platform/out/target/product/generic/ramdisk.img -data $HOME/android/platform/out/target/product/generic/userdata.img
Thanks,
Chris
Upvotes: 10
Views: 37972
Reputation: 178
I had a similar problem when running my emulator, and I solved it by starting the emulator from the command line with the command emulator -avd [your-avd-name]
and then I got the Error ERROR | Not enough space to create userdata partition
which I solved by cleaning up the disk. There was simply not enough free memory to create the Virtual Device in my case.
Upvotes: 0
Reputation: 804
I had a similar problem. The emulator was unresponsive and Android Studio was unable to deploy and run the application. My solution was the following: 1. Open the AVD manager 2. On right hand side menu of the virtual device issue the commands "Stop" and "Wipe data" 3. Then, do a cold boot of the virtual device and voila, it came back to life.
Upvotes: 3
Reputation: 143
Try using adb logcat
in the terminal to see what's happening with the emulator. When I did that I kept noticing
I/ServiceManager( 918): service 'media.audio_flinger' died
I/ServiceManager( 918): service 'media.player' died
I/ServiceManager( 918): service 'media.camera' died
I/ServiceManager( 918): service 'media.audio_policy' died
repeating every 10s or so. I tried enabling my cameras in the AVD and the emulator started working.
To enable the camera enter android avd
in the terminal and set the front and back camera options.
Upvotes: 7
Reputation: 1564
My trick to get the emulator started on a weak machine (RAM: just 1 GB) is to start it as first thing after WinXP has finished booting. Further, using an emulator instance with a smaller resolution (smaller number of pixels on display to emulate, e.g. just 240x400) did also help.
Upvotes: 1
Reputation: 3233
I had this problem and fixed it by deleting the emulator and creating a new one. In eclipse:
It started in about 30 seconds after I did that.
Normally the emulator starts in about 2-3 minutes for me. Then it mysteriously stopped working. I was seeing boot animation for 30 minutes before I gave up. Rebooting my laptop didn't help, which made me think it was a problem with the emulator settings, and I stumbled on this solution.
Upvotes: 11
Reputation: 721
I normally have to restart it to get it to run. Today it wouldn't restart no matter what. Doing a ./adb logcat consistently showed 'waiting for device'. So I restarted it using Eclipse Android SDK and AVD Manager / Start... (option), un-checking the 'Launch from snapshot' option, and after the long grind of load it, the emulator works.
Upvotes: 1
Reputation: 3404
The first startup can take a while, especially on a slow machine but otherwise try running the adb logcat command to see the log output. That will help you determine what the problem could be.
Also if you like to skip supplying all the options to the emulator, i.e. -system and the other you can use the scripts supplied in the build folder. Run these commands from the open source project root folder:
source build/envsetup.sh
setpaths
The first one will run the envsetup script for Android that supplies a number of helpful commands. The second one sets up all the paths needed for Android platform development. Among them are the ANDROID_PRODUCT_OUT variable that informs the emulator where to look for the build images. It is set to the default folders that you have specified above. After running setpaths you can just start the emulator with your build by typing emulator on the command line.
Upvotes: 9