How to Connect with NativeBridge Using ADB: Advanced Testing Capabilities in Your Browser

NativeBridge transforms mobile app testing by allowing you to access native mobile apps directly through your browser. While our browser-based interface is robust on its own, advanced users can enhance their testing experience by linking their local development environment to NativeBridge's remote devices using the Android Debug Bridge (ADB).
This guide will help you set up an ADB connection with devices running on NativeBridge, providing you with advanced testing and debugging features that effectively connect your local development setup with our cloud-hosted devices.
What is ADB and Why Use It with NativeBridge?
Android Debug Bridge (ADB) is a flexible command-line tool that facilitates direct communication between your development machine and Android devices. When used with NativeBridge, ADB offers powerful functionalities:
- Execute automated tests directly on remote devices
- Transfer files between your local machine and the remote device
- Install APKs straight from your development pipeline
- Access device logs for more in-depth debugging
- Utilize tools like scrcpy for improved device controls
Prerequisites
Before getting started, ensure you have:
- An active NativeBridge account with a running device session
- ADB installed on your local machine
- For Windows: Install via Android Studio or download the Platform Tools directly
- For macOS: Install via brew install android-platform-tools
- For Linux: Install via your package manager or download Platform Tools
Connecting to a NativeBridge Device via ADB
Step 1: Launch Your Device Session
Start by launching a device session in NativeBridge. This can be either an emulated device or a real physical device.
Step 2: Access the ADB Connection Details
- In your active device session, locate and click the "Connect With ADB" button in the device control panel.
- A modal will appear displaying a connection command in the format:
adb connect <deviceURL>
- This URL is a unique identifier for your specific device session.
Step 3: Establish the ADB Connection
- Copy the entire
adb connect <deviceURL>
command from the modal. - Open your terminal or command prompt.
- Paste and execute the command:
- If successful, you should see a confirmation message:
connected to device-id-12345.devices.nativebridge.io:7000
Step 4: Verify the Connection
To confirm your device is properly connected, run:
You should see your NativeBridge device listed in the output, showing the status as "device":
Leveraging scrcpy for Enhanced Control
While NativeBridge provides a full browser-based interface, you can also use scrcpy (screen copy) for an alternative way to view and control your remote device with potentially lower latency.
Setting Up scrcpy
1.Install scrcpy on your local machine:
For Windows: Use Chocolatey: choco install scrcpy
For macOS: Use Homebrew: brew install scrcpy
For Linux: Use your package manager (e.g., apt install scrcpy
)
Connecting with scrcpy
- With your ADB connection established, run the following command:
- A new window will open displaying your remote device screen, which you can control using your mouse and keyboard.
Common ADB Commands for NativeBridge Testing Workflows
Once connected, you can use standard ADB commands to interact with your NativeBridge device:
Installing Apps
Pushing Files
Pulling Files (like screenshots or logs)
Running Shell Commands
Capturing a Screen Recording
(Press Ctrl+C to stop recording, then pull the file to your local machine)
Troubleshooting ADB Connections
Connection Refused or Timeout
If you encounter connection issues:
- Ensure your NativeBridge session is active and not timed out
- Attempt the connection again
Try restarting ADB with:
Device Unauthorized
If your device shows as "unauthorized":
- Disconnect the device:
adb disconnect <deviceURL>
- Restart your NativeBridge session
- Reconnect using the new connection details
Port Already in Use
If you see "port already in use" errors:
- Check for processes using the port:
netstat -ano | findstr :<PORT>
(Windows) orlsof -i :<PORT>
(macOS/Linux) - Kill the conflicting process and try again
Benefits for Team Collaboration
ADB connectivity in NativeBridge enhances collaboration between individual developers and the wider team:
Developers can execute automated tests on shared devices without needing physical access.
QA Engineers can confirm issues found during browser sessions using advanced ADB diagnostics.
DevOps can seamlessly incorporate NativeBridge devices into CI/CD pipelines through ADB connections.

Conclusion
By connecting to NativeBridge.io devices via ADB, you merge the ease of browser-based testing with the power and flexibility of local development tools. This hybrid approach offers the best of both worlds: the accessibility of cloud testing combined with the capabilities of local device testing.
Begin integrating NativeBridge's remote devices into your development workflow today, and discover a new level of efficiency in mobile app testing and debugging.