Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can write an Android test with Appium by installing the UiAutomator2 driver, starting an Appium server, and using a client library to open an app, find an element, interact with it, and end the session. This walkthrough uses Python and Appium’s built-in Android Settings app, so you can get started without supplying your own app or buying a phone: an Android Virtual Device (AVD) is also supported.

What you need

  • Appium: the server and CLI, which starts sessions and manages drivers and other extensions.
  • Android SDK Platform and Platform-Tools: set ANDROID_HOME to your Android SDK location so the driver can find them.
  • A Java JDK: set JAVA_HOME to its installation location. The UiAutomator2 setup guide specifies JDK 9 for the most recent Android API levels and JDK 8 otherwise; check the live requirements for your installed driver and Android API before choosing a JDK.
  • A test target: either a running Android Virtual Device or a physical Android device configured for development with USB debugging enabled.
  • A client library: this example uses Python’s Appium-Python-Client. Official client options also include Java, Ruby, and .NET; the Appium ecosystem lists integrations such as WebdriverIO, Nightwatch.js, and Robot Framework.

Use your existing project language and team skills where possible. The capabilities and test logic are the same basic ideas whichever client you choose, but the code and package installation differ.

Prepare Android and install the driver

Set up your emulator or device

Install the Android SDK Platform and Platform-Tools, then configure ANDROID_HOME and JAVA_HOME in your environment. Create and start an AVD in Android Studio if you do not have a physical target. If you use a physical device, enable its developer options and USB debugging, connect it over USB, and verify that Android Debug Bridge can see it:

adb devices

The device or emulator should appear in the command output. If a physical device is listed as unauthorized, unlock it and accept the USB debugging authorization prompt on the device.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Yojaro 4Pack Silicone Suction Phone Case Mount, Silicon Adhesive Smartphones Stand Sticky, Hands-Free Phone Accessories Holder for Selfies and Videos (Black & White & Translucent & Light Pink)
  • 【Strong Adsorption】The inspiration of the silicone phone suction case comes from the adhesive force of the octopus. Each suction cup phone mount is 3.15 inches long and 2.17 inches wide, with 24 independent suction cups providing a stronger and more stable suction force, so you don't have to worry about your phone falling during use.
  • 【Back of Phone Suction Grip】Remove the adhesive film on the phone suction cup and stick it on the phone case. You can then fix the phone on any smooth surface, which is very convenient. (The phone suction cup cannot be removed and reused after being attached to the phone case. It is recommended to attach it to a regular phone case, not a valuable one.)
  • 【Widely Used】Our non-slip silicone phone sticky grip mount attaches to almost any flat phone case and make it compatible with common mobile phones such as iPhone and Android.You can shoot, watch videos or video calls in the kitchen, gym, dance studio, bathroom and other places.
  • 【Capture the Wonderful Picture】Whether you are a TikTok creator or just like to share videos and photos, this phone suction cup can help you hands-free capture wonderful videos and photos for sharing with friends.
  • 【Note】You can fix the phone suction cup on a smooth surface such as a mirror or glass. If necessary, wipe the suction cup with a damp cloth to obtain stronger suction. Before releasing your hand, make sure the phone is firmly fixed. (Not applicable to rough walls, wooden surfaces, and other uneven surfaces)

Install UiAutomator2

Appium needs a platform driver to automate Android. UiAutomator2 is Appium’s official Android driver and supports native, hybrid, and web automation. Install it with the Appium CLI:

appium driver install uiautomator2

The driver uses the Android platform and the session capability appium:automationName set to UiAutomator2. Check the current UiAutomator2 setup guide for version-specific prerequisites, then run its built-in prerequisite check:

Rank #2
Apple EarPods Headphones with USB-C Plug, Wired Ear Buds with Built-in Remote to Control Music, Phone Calls, and Volume
  • SUPERIOR COMFORT — Unlike traditional circular ear buds, the design of EarPods is defined by the geometry of the ear. Which makes them more comfortable for more people than any other ear bud–style headphones.
  • HIGH-QUALITY AUDIO — The speakers inside EarPods have been engineered to maximize sound output and minimize sound loss, which means you get high-quality audio.
  • BUILT-IN REMOTE — EarPods with USB-C plug also include a built-in remote that lets you adjust the volume, control the playback of music and video, and answer or end calls with a pinch of the cord.
  • COMPATIBILITY — Works with all devices that have a USB-C port.
  • INTEGRATED MICROPHONE — A built-in microphone precisely captures your voice while you’re on the phone, taking a FaceTime call, or summoning Siri — so you’re always heard loud and clear.
appium driver doctor uiautomator2

Appium’s CLI also has server, plugin, and setup subcommands; for this first test, you need the server and driver commands above.

Write a minimal Python test

Install the Python client in the environment where you will run the test:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
PopSockets Adhesive Phone Grip, Holder- Black
  • Secure Hold: Our PopSockets adhesive phone grip gives your cell phone a secure, comfortable hold in hand to help prevent drops while texting, taking photos, or scrolling on the go. Designed to stick firmly to most phone cases and devices.
  • Hands-Free Made Easy: Easily turn your PopSocket into a phone stand to prop up your phone anywhere, perfect for watching videos, video calls, or following recipes. A must-have phone holder that keeps your device secure and ready for anything.
  • Compatibility: Works with all phones, tablets, and Kindles. Sticks best to smooth, hard plastic cases and may not adhere to silicone or textured cases. Easily swap your PopTop to change up your style.
  • Black PopSockets: Simple, refined, and endlessly versatile. A timeless essential for any phone.
  • Travel Must-Have for People On the Go: A must-have travel accessory for flights, flying, airports, air travel, airplanes, planes, international trips, cruises, and long travel days. Key gadget for your airport haul, travel accessories and must-haves.
python -m pip install Appium-Python-Client

Create a file named test.py with this complete example:

from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.webdriver.common.appiumby import AppiumBy

options = UiAutomator2Options()
options.platform_name = "Android"
options.automation_name = "UiAutomator2"
options.app_package = "com.android.settings"
options.app_activity = ".Settings"

driver = webdriver.Remote("http://localhost:4723", options=options)
try:
    apps = driver.find_element(AppiumBy.ACCESSIBILITY_ID, "Apps")
    apps.click()
finally:
    driver.quit()

What the test does

  • UiAutomator2Options builds the Android session capabilities. The platform and automation name select the Android driver; the package and activity open the built-in Settings app.
  • webdriver.Remote asks the Appium server at http://localhost:4723 to create a session.
  • find_element locates the Settings item with the accessibility ID “Apps,” and click() taps it.
  • The finally block calls quit() even if element lookup or the click fails, closing the Appium session cleanly.

This sample assumes the target Android image provides the standard Settings app and that its visible item is labeled “Apps.” On a customized emulator or device, the app contents or label may differ; use an element locator appropriate to that target.

Rank #4
360° Rotating Stainless Steel Phone Tether Tab (Silvery 3-Pack) - Universal for iPhone & Other Phones (Fits Wristbands/Necklaces/Crossbody Straps)
  • [360 ° Flexible Rotation Design] Comes with a rotatable lanyard ring that supports 360 ° free rotation, effectively solving the problem of twisted and tangled lanyards
  • [Wide compatibility] The ultra-thin 0.02-inch design does not block the charging port at all, and both wired and wireless charging can be used directly without removing the pad. Compatible with most smartphones such as iPhone, compatible with various wristbands, lanyards, crossbody straps, and keychains
  • [Durable and Portable Material] Premium rust-resistant stainless steel material with good flexibility, which not only avoids scratching the phone case, but also has excellent anti rust and anti fading performance
  • [Multi scenario Practical] Paired with a lanyard or wristband, hands-free use can be achieved. The phone is within reach and not easily dropped, ideal for daily commuting and outdoor activities. Suitable for full coverage phone cases, does not support half coverage phone cases
  • [Quality Service] If you find any damage or other issues with the product upon receipt, please contact us immediately. We will handle it quickly

Run the test

  1. Start the AVD or connect and authorize the Android device. Confirm it appears in adb devices.
  2. In a separate terminal, start the Appium server with appium. The Python client example connects to http://localhost:4723.
  3. From the Python environment where you installed the client, run python test.py.

If the session starts successfully, Appium opens Settings, taps “Apps,” and then quits the session. Keep the server terminal open while the test runs.

Choose an emulator or a physical device

Target Choose it when Setup to check
Android Virtual Device You want to begin without connecting physical hardware, or an emulator is sufficient for the behavior under test. Create and launch an AVD, and confirm the Android SDK and platform tools are available.
Physical Android device Your test needs access to real hardware or a device configuration not represented by your AVD. Enable development options and USB debugging, connect the device, accept its authorization prompt, and confirm it appears in adb devices.

Neither target is a universal winner; choose according to the test’s hardware needs and the target you can configure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anteel 2 Pack Silicone Suction Cup Phone Case Mount Double Sided, Hands-Free Silicon Phone Grip with Higher Suction Power for Selfies and Videos, Non Slip Phone Accessories (LightPink&White)
  • 【PKYAA Double Sided Silicone Suction Phone Case Mount】PKYAA With Double Sided 40 Strong and Reliable individual suction cups, PKYAA provides a thicken and upgraded universal silicon suction mount for your phone.
  • 【Friendly to Content Creators】If you are a content creator or an online influencer, you can create videos anywhere with this suction mount completely hands free with this silicone cell phone mount for cases.
  • 【HANDS-FREE & Adhere to Mirrors】This Double Sided silicone suction phone case mount allows you to stick your phone to the mirror easily. No longer holding your phone in one hand to watch video tutorials while making up.
  • 【Strong Grip on the Smooth Surface】You can easily hang your phone anywhere with a smooth surface. All you do is you clean off your phone and smooth surface. It is STURDY and it not only sticks to mirrors, it also sticks to windows, it sticks to refrigerators, tiles and other clean, flat surfaces.
  • 【Press Down Firmly Every 30 Minutes】Use your palm or fingers to press the phone down firmly and check it's secure before letting go. Apply even pressure for a few seconds to allow the suction cup to adhere properly. To maintain the grip and prevent accidental falls, it's a good practice to periodically reapply pressure to the suction cup.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common setup failures

Symptom Likely cause What to check or do
Appium cannot create an Android session or reports that the automation name is unavailable. The UiAutomator2 driver is missing, or the session does not select it. Run appium driver install uiautomator2 and set the automation name to UiAutomator2.
The driver doctor reports missing Android or Java prerequisites. The SDK tools, ANDROID_HOME, JDK, or JAVA_HOME are absent or point to the wrong installation. Install Android SDK Platform and Platform-Tools, verify both environment variables, and check the current driver guide for the JDK requirement matching your Android API and driver version.
No Android target is available to Appium. The AVD is not running, or a physical device is disconnected, unauthorized, or not configured for USB debugging. Start the AVD or reconnect and authorize the device; check adb devices again.
The client cannot connect to http://localhost:4723. The Appium server is not running, or the client URL does not match the server address. Start appium in a separate terminal and use the matching server URL in the test.
The test fails while looking for “Apps.” The target Settings app may not contain that item or accessibility label. Confirm the Settings app opened on the chosen Android image and update the locator to match the element exposed by that target.

Or skip the browser setup

For screenshots of web pages rather than interactive Android app tests, ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF. Its request parameters include the options other screenshot APIs use, which can make switching straightforward.

For example, save a screenshot of a page as WebP with cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for authentication and request options. Before capture, it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and whether the request was billed. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents using Claude, Cursor, or another MCP client. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.