Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsUse Android UI Automator when an instrumented test must interact with visible Android UI beyond your app—such as a permission dialog, Settings, the launcher, or another installed app. For new tests, Android recommends its modern Kotlin DSL, built around uiAutomator {}, predicate-based element lookup, and explicit app-state operations. Add the stable AndroidX dependency, run the test on an emulator or device, and assert a user-visible result.
When to use UI Automator
UI Automator is suited to functional tests that operate through the UI across app boundaries. It can test journeys involving system UI or another installed app, making it useful when the interaction behaves like a person tapping through the device rather than a test calling into one app’s internals. Android describes this as opaque-box UI testing: the test interacts with what is visible. Android’s UI Automator guide covers the current API.
Choose the test framework according to the screen and the boundary being tested:
| Framework | Best fit | Decision point |
|---|---|---|
| UI Automator | Cross-app flows, system UI, and other installed apps | Does the test need to cross an app or system boundary? |
| Espresso | Many View-based interactions within one app | Would synchronization with the app’s main thread help keep interactions reliable? |
| Compose testing APIs | Compose screens and components | Does the test need Compose-specific control over time, animations, or recomposition? |
| Robolectric | Local JVM tests on a workstation or CI | Does the test need to run as a host-side JVM test instead of on a device or emulator? |
These tools are not interchangeable. For a View-based screen contained within your own app, Android recommends considering Espresso; for Compose UI, use its dedicated testing APIs. Reach for UI Automator when the scenario requires visible interaction across boundaries.
#1 Best Overall
- 【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)
Set up an instrumented test
Add the stable UI Automator dependency
The AndroidX release notes list UI Automator 2.4.0 as stable, dated July 1, 2026. In a Kotlin Gradle build, add this dependency to the module containing your tests:
dependencies {
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.4.0")
}
For a Groovy Gradle build, use:
dependencies {
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.4.0'
}
The modern guide’s captured setup example uses an alpha coordinate, while the later AndroidX release notes identify 2.4.0 as stable. Use the stable release coordinate above for a new setup. See the AndroidX UI Automator release notes.
Configure and run the test
UI Automator tests are instrumented tests: they run on an Android device or emulator, with AndroidJUnitRunner launching the test package. Put the test in the instrumented-test source set, typically src/androidTest/java (or the matching Kotlin directory). In the module’s Gradle configuration, set the runner:
Rank #2
- 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.
android {
defaultConfig {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
}
Then run the module’s connected Android test task, for example:
Free tools Windows power users keep installed
One-click scans. No signup required.
./gradlew connectedDebugAndroidTest
The exact Gradle task can vary with your module and build variants. Android’s instrumented-test guide explains the execution model and setup.
Write a Kotlin test with the 2.4 DSL
The following example starts an app, finds a button by visible text, taps it, and checks for a resulting label. Replace the package name and UI text with values from your app. It uses the recommended 2.4-style uiAutomator {} scope; unlike older examples, it does not use the legacy UiDevice, UiObject2, or BySelector pattern.
Rank #3
- 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.
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.uiautomator.uiAutomator
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.assertNotNull
@RunWith(AndroidJUnit4::class)
class CheckoutUiTest {
@Test
fun tappingContinueShowsConfirmation() = uiAutomator {
startApp("com.example.shop")
val continueButton = onElement {
textAsString() == "Continue"
}
continueButton.click()
val confirmation = onElement {
textAsString() == "Order review"
}
assertNotNull(confirmation)
}
}
The DSL’s element queries have conditional wait behavior, so a query can wait for its predicate rather than requiring an immediate match. Use selectors that represent the intended UI, then assert the condition the user should see. Check the exact imports and DSL details against the current Android UI Automator guide, since API details can evolve.
Make tests discoverable and robust
Prefer semantic selectors
Use stable resource IDs where available, or meaningful text and content descriptions. Android’s legacy guidance recommends giving visible elements text labels and/or android:contentDescription values, which also improves accessibility. Avoid screen coordinates when an element can be located semantically: coordinates are sensitive to device size, orientation, layout changes, and localization. See the legacy UI Automator guidance for its selector advice; its API examples are for the older API, not the modern DSL.
Establish the state the scenario needs
Use the DSL’s app-state operations deliberately. startApp can open the target app; startActivity can reach an activity directly when that is the setup your scenario requires; clearAppData resets app data when a clean state is necessary. Avoid clearing data by default if the test is meant to exercise a returning-user journey or preserve a deliberately configured state.
Rank #4
- [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
Handle interruptions and asynchronous UI
Register watchFor for a genuinely expected interruption, such as a permission prompt, rather than treating every dialog as something to dismiss. The API also includes waitForAppToBeVisible and waitForStable. Use a wait that matches the event being tested, then assert the expected element or screen. A stable accessibility tree does not prove that all background work has finished; do not replace a meaningful assertion with a stability check or an arbitrary sleep. The modern API guide documents these operations.
Test system UI and other apps
For a flow involving a permission surface, Settings, the notification shade, launcher, or a separate installed app, UI Automator is the relevant choice because the test must interact beyond the target app’s own UI. Make sure the test establishes the correct starting state—for example, a permission has not already been granted if the scenario is specifically about the permission prompt—and then locate the visible system or app UI using stable text or accessibility properties where possible.
System surfaces can differ across Android versions, device manufacturers, locales, and window configurations. Keep the assertion focused on the outcome the user needs, and run on the Android versions and form factors relevant to your app rather than assuming one system dialog layout is universal. UI Automator 2.4 also documents accessibility window-node support for multi-window scenarios; use that when the tested flow genuinely involves multiple windows.
Best Value
- 【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.
Expand coverage without making the suite brittle
Choose a deliberate compatibility matrix rather than trying every possible combination. Android recommends testing across relevant API levels, orientations, locales, and form factors. An emulator is supported and is useful for repeatable, broad runs; physical devices add coverage when real-device behavior matters. No particular phone or tablet model is required by UI Automator. See Android’s UI test guidance.
- Cover the Android API levels your app supports or that carry meaningful behavior differences.
- Include portrait and landscape only where the product supports or depends on both.
- Test locales that affect text, direction, or layout in important user flows.
- Include relevant form factors, such as tablets, if your app presents materially different UI there.
- Use physical hardware when device-specific behavior matters, while retaining emulator runs for repeatability.
Common failures and practical fixes
- An element lookup times out or finds nothing: confirm the app reached the intended screen, check the exact text or selector property, and prefer a resource ID or content description that is stable across locales if one is available.
- The test works only at one size or orientation: replace coordinate-based actions with semantic selectors, then verify the layout and selector on each supported configuration.
- A permission dialog does not appear: inspect the current app permission state; the scenario may be reusing a device where permission was previously granted. Reset only the state required by the test.
- A test passes before the asynchronous result is ready: wait for the expected condition and assert it. Do not assume a stable accessibility tree means background work is complete.
- A snippet using
UiDevicedoes not match the new DSL: it likely comes from the 2.3-era legacy API. Keep legacy and 2.4 DSL examples distinct, or migrate the test using the modern guide. - The instrumented test does not launch: verify that it is in the androidTest source set, the test runner is configured, and an emulator or device is connected and available for the selected build variant.
Or skip the browser setup
UI Automator runs native Android instrumented tests on an emulator or device. If your test or workflow also needs website screenshots, ScreenshotNeo offers a separate website screenshot API: one GET request returns a PNG, JPEG, WebP, or PDF. Its capture can accept cookie banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, with response headers identifying the page verdict and billing status. It also provides an MCP server for AI agents, including Claude, Cursor, and other MCP clients.
For example, this cURL request captures Stripe as WebP. Create an API key and see the ScreenshotNeo API documentation for options:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo’s free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for the free plan.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Frequently Asked Questions
Does UI Automator require a physical Android device?
No. Tests can run on an emulator or an Android device.
Can UI Automator interact with Settings or permission dialogs?
Yes. It is intended for visible UI interactions that can cross into system UI or another installed app.
Should I use UI Automator or Espresso for a screen inside my app?
For many View-based tests within one app, Android recommends Espresso; use UI Automator when the scenario crosses an app or system boundary.
Quick Recap
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.




