October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Mountain View desk6 min

How to Run Detox Tests on BrowserStack App Automate (Android)

A practical Android-focused walkthrough for running Detox on BrowserStack App Automate, from package selection and APK builds to uploads, cloud configuration, Local Testing, and debugging.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

BrowserStack’s documented Detox cloud workflow runs React Native UI tests on real Android devices: build the app and Detox test-client APK, upload both, configure the BrowserStack Detox package and cloud session, then run the test configuration. BrowserStack currently labels Detox support beta, so check its current guide before adopting a package version or configuration.

What you need before you start

  • A React Native Android project configured for Detox, plus Android build tooling that can run the project’s Gradle tasks.
  • A BrowserStack Username and Access Key. Keep the key in a secret store or environment variables; do not commit it.
  • The Android app-under-test artifact and the generated Detox app-client artifact. They are separate uploads and both IDs are needed in the cloud configuration.
  • If the app depends on a development server or backend that is private to your network, BrowserStack Local configured as a secure tunnel.

The instructions below cover the documented Android cloud path. BrowserStack’s general App Automate device catalogue includes iOS and Android, but that is not evidence of Detox cloud execution on iOS. Confirm current platform support with BrowserStack before planning an iOS cloud run. Its Detox overview describes testing native and hybrid apps on real Android phones and tablets: Detox overview.

Choose the BrowserStack Detox package

For Detox 20.51.3 and later, BrowserStack’s guide specifies this dependency in package.json:

"detox": "npm:@browserstack/[email protected]"

For earlier Detox versions, the guide documents this package path:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
"detox": "npm:@avinashbharti97/detox@^20.26.3"

BrowserStack says it continues to support older Detox versions with their previous configurations, while new patches and updates go to @browserstack/detox. The package and configuration are version-sensitive. After changing the dependency, the guide advises removing node_modules and package-lock.json, then reinstalling dependencies. If the app build fails after switching packages, it suggests trying the original Detox version; treat that as a troubleshooting option, not a guaranteed fix. Follow the current getting-started guide for the exact compatible configuration.

Bundle and build the Android app and test client

Bundle the React Native app

For the guide’s Metro-based example, create the Android assets directory and place the production JavaScript bundle and resources there. Adapt the command if your project uses another bundler or entry file:

mkdir -p android/app/src/main/assets
npx react-native bundle --platform android --dev false --entry-file index.js 
  --bundle-output android/app/src/main/assets/index.android.bundle 
  --assets-dest android/app/src/main/res

Allow the loopback request used by Detox

BrowserStack’s Android build guidance says Detox makes unencrypted requests to the loopback interface. Configure the app’s network_security_config.xml to permit cleartext traffic for 127.0.0.1 under the appropriate domain configuration. This is an app-level Android network-security setting; it is separate from the secure BrowserStack Local tunnel used to reach private development services.

Rank #2
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.

Build both APKs

From the Android project directory, run the tasks shown in BrowserStack’s guide:

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

The first task builds the app under test. The second produces the Android test client APK, which contains the Detox test suite and is analogous to an Espresso test-suite APK. Confirm the generated paths for your project before uploading; the examples below use common Gradle output locations.

Upload the app and app client

Upload each artifact to its own BrowserStack endpoint. The API accepts APK or AAB uploads using multipart file or a publicly accessible url; these examples upload local APK files. Set credentials in the shell first, preferably from your CI secret store:

Rank #3
Sale
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
export BROWSERSTACK_USERNAME="your-username"
export BROWSERSTACK_ACCESS_KEY="your-access-key"

curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" 
  -X POST "https://api-cloud.browserstack.com/app-automate/detox/v2/android/app" 
  -F "file=@android/app/build/outputs/apk/debug/app-debug.apk"

curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" 
  -X POST "https://api-cloud.browserstack.com/app-automate/detox/v2/android/app-client" 
  -F "file=@android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk"

The app upload response includes an app_url; the client upload response includes an app_client_url. Each contains a bs:// identifier. Use the identifier from the current matching build pair in your Detox configuration. Both upload APIs document a custom_id option if you want a stable reference across build uploads. BrowserStack’s API documentation says uploaded app and app-client builds expire after 30 days, so refresh stale identifiers rather than treating them as permanent:

Configure and run the cloud Detox test

Use BrowserStack’s current sample configuration shape for your installed package version. The configuration needs both uploaded bs:// IDs, an Android cloud device, BrowserStack authentication, and session metadata. The documented cloud Detox server is wss://detox.browserstack.com/init. Because this schema and package compatibility can change, copy the current configuration fields from the official guide rather than transplanting an older example.

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

Once the cloud configuration is defined, the guide’s sample command is:

Rank #4
Sale
Samsung Galaxy S26 Ultra, Unlocked Android Smartphone, 512GB, Black
  • PRIVACY DISPLAY: Automatically hide your screen from those beside you. The built-in privacy display can be preset¹ to turn on when receiving notifications, typing passwords, or using specific apps
  • TYPE IT IN. TRANSFORM IT FAST: Enhance any shot in seconds on your smartphone by using Photo Assist² with Galaxy AI.³ Add objects, restore details, or apply new styles by simply typing or tapping
  • NIGHTS, CAPTURED CLEARLY: From gigs to city lights, record and capture moments after dark with clarity using Nightography so your photos and videos stay crisp and clear on your Samsung Galaxy
  • MAKE IT. EDIT IT. SHARE IT: Turn everyday moments into something personal with creative tools built right into your mobile phone, whether it’s a special contact photo, custom wallpaper, an invitation or more⁴
  • HELP THAT KEEPS UP: Stay in the moment while Now Nudge with Galaxy AI helps you respond faster and stay organized with smart suggestions⁵ that appear exactly when you need them on your phone
detox test -c android.cloud.debug --loglevel trace

BrowserStack says test results and debugging details appear in the App Automate dashboard. Its Detox session API can retrieve logs when you have the session ID, which is available from CLI output or the dashboard. The guide also describes collecting logs and screenshots for failures in CI; enable that artifact collection and debug logging in your pipeline if you need failure evidence outside an interactive run.

Connect a locally hosted app or backend

Uploading the Android binaries does not by itself make a private development server or backend reachable from a BrowserStack device. BrowserStack directs users testing local apps to establish BrowserStack Local first. Its Local binary uses secure WebSockets (WSS), and the tunnel is a separate networking prerequisite from permitting Detox’s loopback request inside the Android app. See the current Detox Local Testing guide for setup and tunnel options; the precise Local configuration is not established by the getting-started workflow described here.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common failures

  • Dependency installation or app build breaks after changing Detox: verify the package version against the current BrowserStack guide, remove node_modules and package-lock.json, reinstall, and retry. If integration still breaks, BrowserStack suggests trying the original Detox version with its corresponding setup.
  • Cloud session cannot find the app or test client: check that the app and app-client IDs are copied from their respective upload responses, both refer to the intended build, and neither upload has aged past its 30-day expiry.
  • Tests cannot reach a local API or development site: create and connect the BrowserStack Local tunnel before running the test; a successful binary upload is not a substitute for network access.
  • Loopback or cleartext networking fails during app startup: check the Android network security configuration permits the required loopback domain as described by BrowserStack, then rebuild and re-upload the app artifact.
  • Failure is hard to diagnose: use the dashboard’s session debugging details, run with --loglevel trace, and retrieve logs through the documented session API using the session ID.

Or skip the browser setup

If you need a website screenshot rather than a Detox mobile-app test, ScreenshotNeo provides a one-request screenshot API. It is a different tool for browser-page capture, not a replacement for running Detox tests on Android devices.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Tracfone Moto g Play 2024 Prepaid Phone with a 1-Yr Plan Included
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Activating is easy, just 3 steps.
  • ACTIVATION Promotion: Includes 1500 min, 1500 texts & 1500 MB Data + add more as you need it
  • CAMERA SYSTEM: 50MP Quad Pixel camera. Capture sharper, more vibrant photos day or night with 4x the light sensitivity.
  • PERFORMANCE: Blazing-fast Qualcomm performance. Get the speed you need for great entertainment with a Snapdragon 680 processor and 4GB of RAM.
  • 64GB built-in storage. Get plenty of room for photos, movies, songs, and apps. Made for US

Example cURL request (see the ScreenshotNeo API documentation):

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

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server gives AI agents screenshot and page-info tools. The free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.

Frequently Asked Questions

Does BrowserStack’s Detox workflow run on iOS cloud devices?

The documented cloud Detox workflow covered here is Android-focused. BrowserStack’s broader iOS device catalogue does not establish Detox cloud support for iOS.

Can I use the uploaded BrowserStack build identifiers indefinitely?

No. The Android app and app-client upload API documentation says those uploads expire after 30 days.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.