Running android emulator using nexus 5 factory image - android

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?

Related

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

Creating an AVD and linking it to the AOSP

I am trying to use this tool GemDroid https://github.com/huz123/GemDroid_QEMU. I have downloaded the AOSP android-4.4.4_r2 and built it as well. According to the link above, an AVD has to be created using Android Studio, which I did but it give selective options to download a system image, say an Android 4.4.
My first question is how can I link the AVD to the AOSP I have
downloaded? I tried pointing the location of the SDK to the AOSP
location from Files>ProjectStructure in Android Studio but it says
"SDK does not contain any platforms".
Is there a different way whereI can create an AVD directly from the
directory of AOSP?
Or according to the step "start the emulator with
your android virtual device as usual" in the link above, how can I
start the emulator from AOSP with an AVD created using Android
Studio?
I am using Ubuntu 14.04. Please help, thanks!
You don't need the Android Studio for that - just go to your root directory and type in the command line:
emulator
If this doesn't work you probably had a problem in your build.(Build the AOSP)
This is how I run the build
source ./build/envsetup.sh
lunch aosp_shamu-userdebug
./prebuilts/android-emulator/linux-x86_64/emulator
-sysdir out/target/product/shamu/
-system out/target/product/shamu/system.img
-ramdisk out/target/product/shamu/ramdisk.img
-data out/target/product/shamu/userdata.img
-kernel prebuilts/qemu-kernel/arm64/kernel-qemu
-scale 0.7
-memory 2048
-partition-size 4096
-no-window
-verbose

Running Android 5.0.1 x86 virtual device with host GPU disabled

I am working on automating screenshots capture for one of my apps.
Since I want to capture screenshots of some activities and widgets that differ according to the system locale, I start for each desired language a new Android virtual device (emulator) with the correct properties for setting the system locale. Then, specific user interactions are simulated with uiautomator.
My workflow is working as expected but I have an issue with screenshots capture. Indeed, using UiDevice.takeScreenshot(File storePath) or screencap on the emulator always creates an empty file.
It seems to be a known issue with AVD running with Host GPU enabled (which is my case). The proposed workaround is to start the emulator with Host GPU disabled. Unfortunately, when I start the virtual device with Host GPU disabled, the emulated screen remains black.
I have taken a look at the output of the emulator with the -verbose option and abd -e logcat command (emulator output, logcat output). In logcat ouput I have identified the following error but I cannot figure out the cause of it:
E/SurfaceFlinger( 929): hwcomposer module not found
E/SurfaceFlinger( 929): ERROR: failed to open framebuffer (No such file or directory), aborting
Below is the command I use to start the emulator:
LD_LIBRARY_PATH=$ANDROID_HOME/tools/lib:$LD_LIBRARY_PATH emulator -avd screenshots -skin nexus_6 \
-skindir $ANDROID_STUDIO_HOME/plugins/android/lib/device-art-resources -no-audio \
-prop persist.sys.language=en -prop persist.sys.country=en -verbose -qemu -m 512 -enable-kvm &
I am running Fedora 21 with an Nvidia GPU.
Does someone has succeeded to start an Android virtual device with a recent system image with Host GPU disabled? Any help or suggestion is welcomed.
Holy cow! The problem I am facing is a known issue. Workaround is to use a skin with lower screen resolution (e.g. nexus_4).

android emulator built from source won't boot up

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.

Android: Emulator -ramdisk command line option is broken

While trying to follow the Tweaking the Android Emulator to include the Scala libraries natively on the emulator, I can't get the custom ramdisk image to load. It appears that the emulator -ramdisk command line option is ignored.
Thanks to Colin on the scala-on-android Google group, he confirmed that there is a defect in the emulator's -ramdisk option.
His workaround, which I verified successfully is to copy the ramdisk.img to the directory of the AVD that you wish to use. On Windows, the AVD files are stored at c:/Users/[UserName]/.android/avd. On Linux, they are stored at ~/.android/avd.
After the ramdisk.img is copied, just start the emulator as usual (no -ramdisk option is necessary).

Categories

Resources