budtmo / docker-android

Android in docker solution with noVNC supported and video recording
Other
8.8k stars 1.19k forks source link

[🐛 Bug ]: Problems with installing apk over the appium #444

Open pawlakmaly opened 4 days ago

pawlakmaly commented 4 days ago

Operating System

Windows 11/WSL2 (Ubuntu 22)

Docker Image

budtmo/docker-android:emulator_13.0

Expected behaviour

Once I've start Appium server in the android docker image I expect to be able to install apk over appium capabilities from my framework.

Actual behaviour

Attempt to install the apk in above way end's up with error:

[0-0] 2024-07-01T09:33:39.090Z WARN webdriver: Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: Could not sign '/apps/*****.apk' with the default certificate. Original error: Exception in thread "main" java.nio.file.AccessDeniedException: /apps/******.apk

Logs

I'm using devcontainer based on yaml with two services, onedevcontainer and one with android emulator: ` androidSamsung: hostname: android container_name: android image: budtmo/docker-android:emulator_13.0_v2.5.4-p1 privileged: true environment: EMULATOR_DEVICE: "Samsung Galaxy S10" WEB_VNC: "true" WEB_LOG: "true" APPIUM: "true" APPIUM_ADDITIONAL_ARGS: "--relaxed-security --allow-insecure=[unsafe-perm]" ports:

I used wdio on my devcontainer: capabilities: [ { // capabilities for local Appium web tests on an Android Emulator 'platformName': 'Android', 'maxInstances': 1, // For W3C the appium capabilities need to have an extension prefix // http://appium.io/docs/en/writing-running-appium/caps/ // This isappium:for all Appium Capabilities which can be found here 'appium:udid': 'emulator-5554', 'appium:platformVersion': '13.0', 'appium:orientation': 'PORTRAIT', 'appium:automationName': 'UiAutomator2', // The path to the app 'appium:app': resolve('/', 'apps', process.env.APK_FILE_NAME + '.apk'), 'appium:language': 'en', 'appium:locale': 'GB', 'appium:appWaitActivity': '*', 'appium:waitForIdleTimeout': 1, 'appium:newCommandTimeout': 240, 'appium:noReset': false, 'appium:fullReset': false, 'appium:permissions': 'CAMERA', 'appium:skipServerInstallation': false, }, ],

pawlakmaly commented 2 days ago

I've found myself solution for that - In my Dockerfile for devcontainer with my setup I've add folder with my APK and set owner for user from Android Emulator container.