Registry / testing / appium-uiautomator2-server

appium-uiautomator2-server

JSON →
library9.11.2jsnpmunverified

The `appium-uiautomator2-server` is a critical internal component of the Appium automation framework, specifically designed to enable automated testing on Android devices utilizing Google's UiAutomator2 framework. It functions as a lightweight Netty server that is deployed directly onto the Android device under test. This server component listens for automation commands transmitted from an Appium client (typically via the `appium-uiautomator2-driver`) and subsequently executes these commands by interacting with the native UiAutomator2 APIs on the device. Currently at version 9.11.2, the package is actively maintained by the Appium team, with a consistent cadence of minor releases and bug fixes, as evidenced by its recent changelog, ensuring ongoing compatibility and performance. While distributed as an npm package, it is not intended for direct programmatic JavaScript/TypeScript consumption by end-users, but rather serves as a deployable binary for the Appium ecosystem, bridging the gap between test scripts and Android UI interactions.

npm install appium-uiautomator2-server
INSTALL
IMPORT
SIG · APPIUM-UIAUTOMATOR
A
appium-uiautomator2-server
testingjavascriptv9.11.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

N/A
// appium-uiautomator2-server is an internal Appium component; no direct JavaScript imports are typically used by end-user scripts.
import { UiAutomator2Server } from 'appium-uiautomator2-server'; // Incorrect usage for this package const UiAutomator2Server = require('appium-uiautomator2-server'); // Incorrect usage for this package
This package primarily bundles a Java server (.apk files) which the Appium server deploys to an Android device. End-user JavaScript/TypeScript test scripts interact with the Appium client library (e.g., WebdriverIO), not directly with this server component's npm package.

Demonstrates a typical Appium client-side setup using WebdriverIO to interact with an Android device, which implicitly leverages the appium-uiautomator2-server component deployed on the device. This code does not directly import or use 'appium-uiautomator2-server'.

import { remote } from 'webdriverio'; const capabilities = { platformName: 'Android', 'appium:automationName': 'UiAutomator2', 'appium:deviceName': 'Android Emulator', 'appium:platformVersion': '11', 'appium:app': '/path/to/your/app.apk', // Replace with your app's path or package/activity 'appium:noReset': true, // Other capabilities as needed, e.g., 'appium:appPackage', 'appium:appActivity' }; async function runAppiumTest() { let driver; try { driver = await remote({ hostname: process.env.APPIUM_HOST ?? 'localhost', port: parseInt(process.env.APPIUM_PORT ?? '4723', 10), path: '/wd/hub', capabilities, }); console.log('Appium session started successfully.'); // Example: Interact with a native element using UiAutomator2 locator const el = await driver.$('android=new UiSelector().text("Hello World!")'); if (await el.isDisplayed()) { console.log('Found element with text "Hello World!"'); await el.click(); } // Example: Perform a scroll action await driver.execute('mobile: scroll', { strategy: 'accessibility id', selector: 'SomeScrollableList', direction: 'down' }); // More interactions here... } catch (error) { console.error('Appium test failed:', error); } finally { if (driver) { await driver.deleteSession(); console.log('Appium session ended.'); } } } runAppiumTest().catch(console.error);
Debug
Known issues
breakingThis package has strict Node.js engine requirements, specifically `^20.19.0 || ^22.12.0 || >=24.0.0`. Using incompatible Node.js versions can lead to installation failures or runtime instability of Appium and its drivers.
fix
Ensure your Node.js environment matches the specified engine requirements. Use a Node Version Manager (e.g., nvm or Volta) to switch versions if needed to `20.19.0+`, `22.12.0+`, or `24.0.0+`.
affects: >=9.0.0
gotchaThe `appium-uiautomator2-server` is a backend component of the Appium ecosystem. It is not designed to be started or managed directly by end-user scripts or run as a standalone server. It requires a running Appium server and the `appium-uiautomator2-driver` to function correctly.
fix
Interact with Android devices via an Appium client library (e.g., WebdriverIO, Appium client for Node.js) connected to an Appium server, which will handle the deployment and management of this server component automatically.
affects: All
gotchaRegularly update the `appium-uiautomator2-server` package to ensure the underlying Netty server components (e.g., `io.netty:netty-codec-http`) are patched against potential network security vulnerabilities and receive performance improvements. These updates are typically bundled in minor version increments of the Appium driver.
fix
Ensure your Appium installation and its drivers are kept up-to-date by regularly running `npm update` in your Appium project or using `appium driver update uiautomator2` if managing drivers via the Appium CLI.
affects: All
Errors
Common errors & fixes
AdbError: adb exited with code 1
Appium's attempt to interact with ADB failed, often due to an unresponsive device, incorrect ADB path configuration, or insufficient permissions.
fix
Verify that your Android device/emulator is connected and recognized by `adb devices`. Check environment variables for `ANDROID_HOME` and `PATH` to ensure `adb` is correctly configured and accessible. Restart the ADB server using `adb kill-server` followed by `adb start-server`.
Failed to create session. An unknown server-side error occurred while processing the command. Original error: UiAutomator2 server not running.
The Appium UiAutomator2 server APK or its test APK failed to install, launch, or establish a connection on the Android device, preventing Appium from communicating with the device UI.
fix
Review the Appium server logs and device logs (logcat) for specific installation or runtime errors. Ensure the Android device has sufficient storage, disable 'Play Protect' (if applicable), and try restarting the device/emulator. Verify 'USB debugging' and 'Install via USB' (if available) are enabled in Developer Options.
An element could not be located on the page using the given search parameters. (NoSuchElementError)
The UI element specified by the locator strategy (e.g., accessibility ID, XPath, resource ID) was not present, visible, or interactable on the device screen at the exact moment of interaction.
fix
Verify the locator strategy is correct and the element is actually present in the application's current state using Appium Inspector. Implement explicit waits (e.g., `driver.waitUntil`) to allow elements time to appear or become interactable before attempting to locate them.
Upgrade
Version history
9.11.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
57 hits · last 30 days
node
54
OpenAI (training)
1
Resources
appium-uiautomator2-server — npm install appium-uiautomator2-server · libregistry