Running Android emulators using QEMU on top of Dockers based on Ubuntu OS

We are currently trying to run Android mobile automation scripts on top of dockers with ubuntu as base image , so i created a dockerfile with the below configurations :

Android Studio: Android Studio Dolphin | 2021.3.1 Patch 1
Appium: App Version 1.19.1
Node.js: v18.12.1
Java: openjdk 17.0.2 2022-01-18 LTS
OpenJDK Runtime Environment Corretto-17.0.2.8.1 (build 17.0.2+8-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.2.8.1 (build 17.0.2+8-LTS, mixed mode, sharing)
Python: 3.10.5
RobotFramework

Below Are the configuration which we have used to create the AVD

hw.ramSize=4096
vm.heapSize=1024
image.sysdir.1=system-images/android-33/google_apis/x86_64/
hw.internalStorage.path=/root/.android/avd/Incident_AVD.avd/sdcard.img
hw.internalStorage.size=16384MB
sdcard.size=16384MB

Installed required depedencies

RUN npm install -g appium@latest @appium/doctor && 

And also installed required SDK tools

And i have included the Android system image for QEMU *86_64

RUN mkdir -p /root/android/system-images && 
    wget -O /root/android/system-images/android-33-google_apis-x86_64.zip 
    "https://dl.google.com/android/repository/sys-img/google_apis/x86_64-33_r05.zip" && 
    unzip /root/android/system-images/android-33-google_apis-x86_64.zip -d /root/android/system-images && 
    rm /root/android/system-images/android-33-google_apis-x86_64.zip

And copied our mobile scripts & required APK’s which are based on Robotframework into the container

We were sucessfully in getting the test case pass(robotframework) by spinning the android emulator using SDK tools.

However we would need to replicate the scenario by using QEMU , So instead of spinning the android emulator from SDK tools we can use QEMU to do it .

I am unable get the QEMU emulator up to run trh scripts , Our ultimate goal is to Work on using a newer light-weight emulator (QEMU) that will avoid any infrastructure changes required for the scripts to run. This facilitates usage of AWS serverless compute engine Fargate.

Below is the command which i am running to bring up the emulator using QEMU.

qemu-system-x86_64 -m 2048 -hda /root/android/system-images/x86_64/system.img -net nic -net user -display none -vga std -machine accel=kvm -cpu host -enable-kvm &   

I am unable to boot the emulator using QEMU , I am manually starting the ADB server & appium server using adb start-server –port=5037 however the ADB server is not getting started .Below is the error which iam coming across

Error :

* daemon not running; starting now at tcp:5037
* daemon started successfully
[Appium] Welcome to Appium v2.11.1
[Appium] Non-default server args:
[Appium] {
  address: '127.0.0.1',
  basePath: '/wd/hub'
}
[Appium] The autodetected Appium home path: /root/.appium
[Appium] Attempting to load driver uiautomator2...
[Appium] Requiring driver at /root/.appium/node_modules/appium-uiautomator2-driver/build/index.js
[Appium] AndroidUiautomator2Driver has been successfully loaded in 1.334s
[Appium] Appium REST http interface listener started on http://127.0.0.1:4723/wd/hub
[Appium] Available drivers:
[Appium]   - [email protected] (automationName 'UiAutomator2')
[Appium] Available plugins:
[Appium]   - [email protected]
[Appium]   - [email protected]
[Appium]   - [email protected]
[Appium] No plugins activated. Use the --use-plugins flag with names of plugins to activate
Starting emulator using QEMU...
Waiting for emulator to start...
WARNING: Image format was not specified for '/root/android/system-images/x86_64/system.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.       
         Specify the 'raw' format explicitly to remove the restrictions.
Waiting for emulator to boot...
Waiting for emulator to boot...
Waiting for emulator to boot...
Waiting for emulator to boot...
Waiting for emulator to boot...
Waiting for emulator to boot...
Waiting for emulator to boot...
Waiting for emulator to boot...
Waiting for emulator to boot...
Waiting for emulator to boot...
Waiting for emulator to boot...

Emulator did not boot in expected time. Exiting...
qemu-system-x86_64: terminating on signal 1

New contributor

Sekhar333 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật