Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32 bit or 64 bit Emulator #16

Open
akarsh opened this issue Apr 27, 2017 · 7 comments
Open

32 bit or 64 bit Emulator #16

akarsh opened this issue Apr 27, 2017 · 7 comments

Comments

@akarsh
Copy link

akarsh commented Apr 27, 2017

Hi @jangrewe ,

I used the docker image for testing the gitlab-ci.
Have you tried functional tests in gitlab-ci for any android project ?

I tried to use android-sdk-linux/tools/emulator -avd test -no-window -no-audio
I ended up with errors of 32 bit.
If you have tried emulator 64 bit emulator64-x86 ?

@jangrewe
Copy link
Owner

jangrewe commented May 8, 2017

Hi @akarsh, i haven't used the emulator in this image at all, but please give some feedback if you figure it out!

@sczerwinski
Copy link

Hi @jangrewe and @akarsh,

I got to the point, where I'm installing required packages and starting the emulator:

androidTests:
  stage: test
  script:
    - apt-get -qq update && apt-get install -qqy --no-install-recommends qemu-kvm && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
    - /sdk/tools/bin/sdkmanager --verbose 'system-images;android-25;google_apis;x86_64'
    - echo "no" | /sdk/tools/bin/avdmanager create avd -f -n api25 -k 'system-images;android-25;google_apis;x86_64' -d "pixel" -c 128M
    - echo "no" | /sdk/tools/emulator -avd api25 -wipe-data -noaudio -no-window -gpu off -verbose -qemu -vnc :2 &
    - timeout 180 /sdk/platform-tools/adb wait-for-device
    - ./gradlew cAT --stacktrace

Unfortunately, shared runners on gitlab.com seem to have KVM disabled in BIOS, so I end up with the following error:

emulator: CPU Acceleration: DISABLED
emulator: CPU Acceleration status: /dev/kvm is not found: VT disabled in BIOS or KVM kernel module not loaded
emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
Please ensure KVM is properly installed and usable.
CPU acceleration status: /dev/kvm is not found: VT disabled in BIOS or KVM kernel module not loaded

@jangrewe
Copy link
Owner

jangrewe commented Oct 5, 2017

Thanks for the feedback, i'll try that out when i have some time, that's probably quite useful for some people.

@alibitek
Copy link

alibitek commented Dec 16, 2017

emulator-check accel or emulator -accel-check commands can tell if hardware acceleration is working correctly:

accel:
0
KVM (version 12) is installed and usable.
accel

GitLab.com shared runners run on Digital Ocean:

From: https://about.gitlab.com/2016/04/05/shared-runners/

All your builds run on Digital Ocean 4GB instances, with CoreOS and the latest Docker Engine installed.

Which seems to have support for KVM.

From:
https://www.digitalocean.com/community/questions/can-i-use-a-droplet-to-create-linux-kvms-while-building-a-vm-management-app
https://www.digitalocean.com/community/questions/does-digitalocean-support-nested-kvm-now

DigitalOcean droplets are KVM based machines.

From: https://wiki.archlinux.org/index.php/KVM

KVM requires that the virtual machine host's processor has virtualization support (named VT-x for Intel processors and AMD-V for AMD processors)
and
KVM is a special operating mode of QEMU that uses CPU extensions (HVM) for virtualization via a kernel module.

Seems like GitLab shared runners are not configured to load the kernel modules that add kvm support

Similar issue: https://forum.gitlab.com/t/cannot-run-android-emulator-avd-in-gitlab-ci/11620

Work in progress:

@burhanyilmaz
Copy link

Hi @jangrewe @sczerwinski,
Did you solve this #16 (comment) ?
I have same problem

emulator: CPU Acceleration: DISABLED
emulator: CPU Acceleration status: /dev/kvm is not found: VT disabled in BIOS or KVM kernel module not loaded
emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
Please ensure KVM is properly installed and usable.
CPU acceleration status: /dev/kvm is not found: VT disabled in BIOS or KVM kernel module not loaded

@nstrelow
Copy link

nstrelow commented Nov 19, 2018

Solutions to this would be greatly appreciated.

But this seems to be in the hands of gitlab and their shared runners:
https://gitlab.com/gitlab-org/gitlab-runner/issues/2242

@oliverspryn
Copy link

I hate to resurrect old threads like this, but since it is still open, I thought I'd share this. Since March 2019, the emulator can now run in Docker with headless mode: https://developer.android.com/studio/releases/emulator#headless-build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants