android emulator built from source won't boot up - android

I downloaded the Android source and built version 2.3.7 (for emulator) with the guide in :
http://source.android.com/source/building.html
It finished with no errors and I got three .img files (about 86 MB total) in the output folder.
Then I typed "emulator" command to start an emulator.
But the emulator just won't boot up. It was stuck at a black screen with CPU running at 100%.
I waited for about 10 mins and it still did not boot up.
Does anybody know why?

I got similar problem as u.
Instead of running emulator, I run below command:
out/host/linux-x86/bin/emulator -sysdir out/target/product/generic/ -system out/target/product/generic/system.img -ramdisk out/target/product/generic/ramdisk.img -data out/target/product/generic/userdata.img -kernel prebuilt/android-arm/kernel/kernel-qemu -sdcard sdcard.img -skindir sdk/emulator/skins -skin WVGA800 -scale 0.7 -memory 512 -partition-size 1024
Then I change the bold to prebuilt/android-arm/kernel/kernel-qemu-armv7
And my problem was fixed.

Related

Can't provide avd path on ubuntu

I'm trying to build avd from console and faced with issue to provide right avd
Cannot find AVD system path. Please define ANDROID_SDK_ROOT
or
PANIC: Unknown AVD name [/home/dmitry/.android/avd/Nexus_4_API_26.avd], use -list-avds to see valid list.
this is what list avd returns to me
Name: Nexus_4_API_26
Device: Nexus 4 (Google)
Path: /home/dmitry/.android/avd/Nexus_4_API_26.avd
Target: Google APIs (Google Inc.)
Based on: Android 8.0 (Oreo) Tag/ABI: google_apis/x86
Skin: nexus_4
Sdcard: 100M
Full command with PATHs
dmitry#dmitry-H270-HD3:~/aosp/oreo$ sudo ./prebuilts/android-emulator/linux-x86_64/emulator -sysdir out/target/product/generic/ -system out/target/product/generic/system.img -ramdisk out/target/product/generic/ramdisk.img -data out/target/product/generic/userdata.img -kernel prebuilts/qemu-kernel/arm64/kernel -qemu-scale 0.7 -memory 2048 -partition-size 4096-verbose -avd Nexus_4_API_26
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
dmitry#dmitry-H270-HD3:~/aosp/oreo$ echo $ANDROID_SDK_ROOT
/home/dmitry/Android/Sdk
dmitry#dmitry-H270-HD3:~/aosp/oreo$ echo $ANDROID_HOME
/home/dmitry/Android/Sdk
dmitry#dmitry-H270-HD3:~/aosp/oreo$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/dmitry/Android/Sdk/tools:/home/dmitry/Android/Sdk/platform-tools:/home/dmitry/Android/Sdk/emulator:ANDROID_AVD_HOME:/home/dmitry/.android/avd
Any thoughts what is the root cause of the issue?
This seems to be an issue relating to the recent update. A temporary solution is to launch emulator from within the /path/to/android-sdk/tools directory in the commandline.
See https://code.google.com/p/android/issues/detail?id=235461 to follow the issue.
source

qemu: could not open gdbserver on device 'tcp::1234'

I have a problem when I study Android kernel Stack-buffer-overflow vulnerability.
Firstly, I create a AVD named "kernel_challenges"
and then, run it using command
"emulator64-arm -show-kernel -kernel arch/arm/boot/zImage -avd kernel_challenges -no-boot-anim -no-skin -no-audio -no-window -qemu -monitor unix:/tmp/qemuSocket,server,nowait -s"
It work well, then I panic it
Panic
Then, I resart the emulator, but it can't start anymore
The emulator can't restart
After restart the Linux, the emulator can start.
How to solve it?
I have solved the problem, when the emulator panic, we should input q in the gdb debug terminal instead of closing emulator forcely

Hello World Android App Emulator not running

Hi guys I am trying to get a basic emulator running to display Hello World but the emulator appears but the phone never switches on. Please help me.
D:\Installed_Softwares\AndroidSDK\tools\emulator.exe -netdelay none -netspeed full -avd Nexus_5_API_24_2
ERROR: resizing partition e2fsck failed with exit code 9
emulator: WARNING: userdata partition is resized from 513 M to 800 M
RegGetValueW failed 2 The system cannot find the file specified.
RegGetValueW failed 2 The system cannot find the file specified.
RegGetValueW failed 2 The system cannot find the file specified.
Hax is enabled
Hax ram_size 0x60000000
HAX is working and emulator runs in fast virt mode.
emulator: Listening for console connections on port: 5554
emulator: Serial number of this emulator (for ADB): emulator-5554
Will be glad to provide more information as needed.
If you are using Windows, you have to resize (downgrade) the RAM of your emulator uses.
Also, try to use an older version of the Android, like 4.2 or 4.4.
To solve the partition issue on Windows:
Install Cygwin and run the e2fsck cmd
# Navigate to AVD and change the API level of the folder
cd C:\Users\%USERNAME%\.android\avd\Nexus_5_API_16.avd
e2fsck -f userdata-qemu.img

Running android emulator using nexus 5 factory image

I've been trying to run the android emulator using nexus 5 factory image.
I've download the factory image and extracted from it the following files:
system.img
boot.img
recovery.img
userdata.img
cache.img
After that, I've extracted from boot.img the ramdisk.img and zImage files.
I tried to run the emulator with the following command:
#!/bin/bash
/home/xx/a/android/sources/out/host/linux-x86/bin/emulator -sysdir /home/xx/a/yy/ -system /home/xx/a/yy/system.img -ramdisk /home/xx/a/yy/boot/initrd.img -data /home/xx/a/yy/userdata.img -kernel /home/xx/a/yy/boot/zImage -sdcard /home/xx/a/android/out/sources/sdcard -memory 512 -partition-size 1024
The emulator will start running without the error, but it will neither show the boot screen nor load the launcher.
It doesn't show any error and i can't get a logcat, meaning, i guess that android hasn't been loaded and it failed earlier.
Now, my question is - What might the reason for it not to work?

Running android app in headless

Can I run android app in headless emulator. I tried with am command but it showed NullPointer Exception. I think as it is a gui application I can't. Is there any way around? The emulator is so slow. It takes like 5-7 mins sometimes. I'm running gingerbread by the way.
Environment: I'm running from qemu source code. From android image and kernel image. The arguments to qemu emulator are something like this:
-sysdir ../../android-image -kernel ../../android-kernel/zImage -no-window -qemu -monitor stdio
From ${android-sdk}/tools run this command:
emulator -avd NAME_OF_EMULATOR -no-skin -no-audio -no-window
In this blog it is nicely explained: http://paulemtz.blogspot.cz/2013/05/android-testing-in-headless-emulator.html

Categories

Resources