diff --git a/README.md b/README.md index b90f49d4e..84fd70794 100644 --- a/README.md +++ b/README.md @@ -1485,6 +1485,22 @@ Name | Type | Required | Description | Example pkg | string | yes | The package name to send the `trimMemory` event to. | com.my.company level | 'COMPLETE' or 'MODERATE' or 'BACKGROUND' or 'UI_HIDDEN' or 'RUNNING_CRITICAL' or 'RUNNING_LOW' or 'RUNNING_MODERATE' | yes | The actual memory trim level to simulate | RUNNING_CRITICAL +### mobile: injectEmulatorCameraImage + +Simulates an image injection into the VirtualScene emulator camera background. +This feature only works on Android emulators. +It might be necessary to restart the camera client app after calling this extension +for the first time as it modifies global emulator's virtual scene settings. +All the further calls should seamlessly change the foreground picture to the supplied one. +This extension could, for example, be useful if you need to verify QR codes scanning +by the application under test. +Available since driver version 3.2.0 + +#### Arguments + +Name | Type | Required | Description | Example +--- | --- | --- | --- | --- +payload | string | yes | A valid base64-encoded .PNG image payload. Other image formats are not supported. This image will be shown on the virtual scene foreground as soon as you open a camera client app. | iVBORw0KGgoAAAANSUh... ## Applications Management diff --git a/lib/execute-method-map.ts b/lib/execute-method-map.ts index f618a960a..a4a60bc29 100644 --- a/lib/execute-method-map.ts +++ b/lib/execute-method-map.ts @@ -598,6 +598,12 @@ export const executeMethodMap = { } }, + 'mobile: injectEmulatorCameraImage': { + command: 'mobileInjectEmulatorCameraImage', + params: { + optional: ['opts'], + } + } } as const; export type Uiautomator2ExecuteMethodMap = typeof executeMethodMap; diff --git a/package.json b/package.json index dcb430160..308a780de 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ }, "dependencies": { "appium-adb": "^12.0.0", - "appium-android-driver": "^9.1.0", + "appium-android-driver": "^9.2.0", "appium-chromedriver": "^5.6.28", "appium-uiautomator2-server": "^7.0.1", "asyncbox": "^3.0.0",