Running android emulator during jenkins build

前端 未结 2 2020
天涯浪人
天涯浪人 2020-12-29 08:15

I have installed Jenkins and configured a build job with emulator running during build. But when I execute the job, I get error message that jenkins user doesn\'t have permi

相关标签:
2条回答
  • 2020-12-29 08:58

    On my CI (gitlab) this was missing on Ubuntu

    usermod -a -G kvm gitlab-runner
    

    or with Jenkins

    usermod -a -G kvm jenkins
    
    0 讨论(0)
  • 2020-12-29 09:01

    I have managed to fix the problem.

    1. Install Qemu-KVM and cpu-checker:
      sudo apt install qemu-kvm cpu-checker
    2. Check if KVM is available (as jenkins user):
      $ kvm-ok
      INFO: /dev/kvm exists
      KVM acceleration can be used
    3. Create group kvm and add jenkins to this group:
      addgroup kvm
      usermod -a -G kvm jenkins
    4. Change group ownership for /dev/kvm:
      chgrp kvm /dev/kvm
    5. Create udev rule:
      $ sudo nano /etc/udev/rules.d/60-qemu-kvm.rules
      KERNEL=="kvm", GROUP="kvm", MODE="0660"
    6. Reboot
    0 讨论(0)
提交回复
热议问题