19 min read

Remote ADB Access: Control Android Devices from Anywhere

Learn how to run remote ADB commands on Android devices over the internet for debugging, app installs, shell access, and remote development workflows.

Android · ADB · Remote Debugging · 2026

Remote Android Debugging over the Internet

ADB, or Android Debug Bridge, can communicate with an Android device over TCP after network mode is enabled. When the device and development computer are on different networks, a Localtonet TCP tunnel can publish the device's ADB listener through a public host and port without inbound router port forwarding, a static public IP address, or VPN setup. This guide explains the legacy adb tcpip workflow, Android Studio integration, security controls, and common troubleshooting steps. Because ADB grants powerful debugging access, use this workflow only on devices you own or are explicitly authorized to administer.

🤖 ADB over TCP · Port 5555 💻 Windows · macOS · Linux 🔒 Dedicated test devices recommended

What Is ADB and Why Use It Remotely?

ADB is a command-line tool included in Android SDK Platform Tools. It lets an authorized computer communicate with an Android device to install and uninstall apps, transfer files, read system logs available to the shell user, run shell commands, and attach supported debugging tools to applications. The exact operations available depend on the Android version, device build, application configuration, user permissions, and device-management policy.

ADB normally communicates over USB. It can also use a network transport when TCP mode or Android's newer Wireless Debugging feature is enabled. Remote access can be useful in several controlled development and support scenarios:

🏠 Device is at a different location A dedicated test device may be in a lab while an authorized developer works elsewhere.
🏢 Local discovery is unavailable Client isolation, mDNS filtering, or separate network segments can prevent normal local discovery and direct peer connections.
🚀 CI and test automation An authorized build system may need to deploy test packages to a dedicated physical device outside its local network.
🔧 Managed field testing Engineers may collect logs from a test kiosk or demonstration unit with the device owner's approval.
👥 Shared hardware testing An authorized team can work with a device that reproduces a hardware-specific defect.
📱 Temporary remote sessions A tunnel can be started for a scheduled debugging session and stopped immediately afterward.

A Localtonet TCP tunnel uses an outbound connection from the Android device to a Localtonet relay and provides a public host and port that forwards to the selected local target. This avoids inbound router port forwarding. It does not guarantee passage through every corporate firewall because a network administrator may block the outbound connection or the public destination port.

How ADB over a Localtonet Tunnel Works

The legacy adb tcpip 5555 command restarts the device's ADB daemon with a TCP listener on port 5555. The Localtonet Android client can then forward a Localtonet TCP endpoint to 127.0.0.1:5555 on the same device. From an authorized development computer, you connect with adb connect <PUBLIC_HOST>:<PUBLIC_PORT>. Use the actual host and port displayed by the current Localtonet dashboard rather than copying an example server name or port.

1

Enable Developer Options and USB debugging

Enable Developer Options using the instructions for your device manufacturer, then enable USB debugging.

2

Switch ADB to TCP mode through an authorized USB connection

Connect the device by USB, approve the host key on the device, and run adb tcpip 5555.

3

Create and start a Localtonet TCP tunnel

Select the device-specific AuthToken, choose an available relay in the current dashboard, set the local target to 127.0.0.1:5555, create the tunnel, and start it.

4

Connect from an authorized development computer

Run adb connect <PUBLIC_HOST>:<PUBLIC_PORT> and approve any debugging authorization prompt shown on the Android device.

Do not treat a raw TCP tunnel as end-to-end TLS

Localtonet documents an encrypted outbound tunnel between the connected client and its relay infrastructure. A standard TCP endpoint does not by itself establish TLS between the remote ADB client and the public endpoint. Legacy ADB-over-TCP authentication should not be described as complete transport encryption. Restrict who can reach the endpoint, use only trusted networks and devices, stop the tunnel after use, and prefer an additional authenticated private-network layer when the risk profile requires end-to-end network protection.

ADB TCP behavior varies by device

Many production devices return to their normal debugging configuration after a reboot, so plan to verify TCP mode again after restarting. Exact behavior can vary by Android release, manufacturer build, device policy, and whether the device is rooted. Do not rely on undocumented persistent system properties or startup scripts for production support.

Prerequisites

What You Need

📱 Compatible Android device A device whose Android build and management policy permit Developer Options, USB debugging, and adb tcpip.
🔌 Data-capable USB cable Used for initial host authorization and to run adb tcpip 5555. It may be needed again after a reboot or configuration change.
🛠 Current SDK Platform Tools Use the copy maintained by Android Studio or download the latest package from Android Developers.
🌐 Localtonet account and device token Create an account and select the device-specific AuthToken in the current dashboard. Keep the token secret.
📲 Localtonet Android app Install the current app on the Android device from Google Play.
🛡 Authorization and access controls Use a dedicated test device, require on-device ADB authorization, and enable IP allowlisting when available for the selected Localtonet plan.

Step 1: Enable Developer Options and USB Debugging


Enable USB Debugging inside Developer Options on your Android device
1

Open the device build information

Open Settings and locate the Build number. Its location differs by manufacturer and Android version.

2

Tap Build number seven times

Tap the Build number repeatedly until the device confirms developer mode. Enter the device PIN or password if requested.

3

Open Developer Options

Return to Settings and open Developer Options. It is commonly under System, but the location is manufacturer-specific.

4

Enable USB debugging

Turn on USB debugging and accept the device warning only if you understand the access being granted.

Samsung menu location

On many Samsung devices, Build number is under Settings → About phone → Software information. Menu labels can change between One UI and Android releases.

Step 2: Enable Legacy ADB TCP Mode via USB


Running adb tcpip 5555 in the command prompt to switch ADB to TCP mode
1

Connect the Android device by USB

Use a data-capable cable. Unlock the device and approve the debugging key fingerprint only if it belongs to your trusted computer.

2

Verify that ADB detects the device

adb devices

The device should be listed with the state device. If it is unauthorized, inspect and approve the prompt on the Android device.

3

Restart the ADB daemon in TCP mode

adb tcpip 5555

A successful command normally reports that ADB is restarting in TCP mode on port 5555.

4

Disconnect USB and verify the remote path promptly

After TCP mode starts, the cable is not required for that session. Keep someone available at the device to approve a new host key if Android requests authorization.

Port 5555 applies to the legacy TCP workflow

The command accepts another available port, but the same local port must be entered in the tunnel configuration. Android 11 Wireless Debugging uses a separate pairing and TLS-based connection workflow with dynamically selected ports, so its instructions should not be mixed with this legacy adb tcpip procedure.

Step 3: Set Up the Localtonet Android App

Localtonet Android App Setup

Google Play TCP Tunnel
1

Install the Localtonet app

Install the current Localtonet Android app from Google Play.

2

Associate the app with its device token

Use the device-specific AuthToken shown in the current Localtonet dashboard. Do not publish, log, or share the token.

3

Keep the client connected

The tunnel is available only while the selected Android client is connected and the tunnel is running. Android background restrictions, battery optimization, or loss of connectivity can interrupt the session.

Step 4: Create and Start the Localtonet TCP Tunnel

1

Open the TCP tunnel interface

Sign in and open the current TCP or TCP/UDP tunnel page. Dashboard names and field labels can change between product versions.

2

Enter the local target

Choose TCP, select the AuthToken belonging to the Android device, select an available relay, set the local IP to 127.0.0.1, and set the local port to 5555. If you used another port with adb tcpip, enter that port instead.

3

Create and start the tunnel

Creating a tunnel does not mean it is running. Use the current Start control while the selected Android client is connected.

4

Record the assigned public endpoint

Copy the exact public host and port displayed by the dashboard. Do not assume a particular server code, region, or public port because availability varies.

Apply access restrictions before connecting

If IP allowlisting is available on your current Localtonet plan, permit only the fixed public IP addresses of trusted development systems or CI runners. Localtonet's current public pricing page lists IP whitelisting under paid tunnel features, so do not assume it is included with every plan.

Step 5: Connect ADB from the Development Machine

1

Open a terminal

Use Command Prompt, PowerShell, Terminal, or another shell in which the current adb executable is available.

2

Connect to the assigned endpoint

adb connect <PUBLIC_HOST>:<PUBLIC_PORT>

Replace both placeholders with the values displayed for the running tunnel.

3

Verify and authorize the connection

adb devices -l

If Android displays a key fingerprint prompt, compare and approve it on the device. Do not approve an unexpected host. The endpoint should eventually appear with the state device.

4

Use standard ADB commands

# Install a debuggable or otherwise permitted APK:
adb -s <PUBLIC_HOST>:<PUBLIC_PORT> install myapp.apk

# View logs available to the ADB shell:
adb -s <PUBLIC_HOST>:<PUBLIC_PORT> logcat

# Open an ADB shell:
adb -s <PUBLIC_HOST>:<PUBLIC_PORT> shell

# Capture and retrieve a screenshot:
adb -s <PUBLIC_HOST>:<PUBLIC_PORT> shell screencap -p /sdcard/screen.png
adb -s <PUBLIC_HOST>:<PUBLIC_PORT> pull /sdcard/screen.png

# Push a file to shared storage:
adb -s <PUBLIC_HOST>:<PUBLIC_PORT> push myfile.txt /sdcard/

If exactly one device is connected, the -s selector may be omitted. Application signing rules, Android permissions, storage restrictions, enterprise policy, and production-build restrictions still apply.

Using Android Studio with the Tunnel


Android Studio detects any device connected via adb connect, including remote tunnel connections

Android Studio uses ADB to discover connected devices. After the command-line ADB server has an authorized connection to the public tunnel endpoint, the device can appear in Android Studio's target-device menu. Make sure the terminal and Android Studio use compatible, current Platform Tools. If multiple ADB installations are running, they can conflict.

1

Open the Android Studio project

Confirm that the project is configured for the connected device's Android version and architecture.

2

Connect with the same SDK Platform Tools

Run adb connect <PUBLIC_HOST>:<PUBLIC_PORT> using the ADB installation managed by Android Studio when possible.

3

Select the authorized device

Open the target-device menu and select the remote device after it appears. Model labels vary by device and Android version.

4

Run or debug within normal Android restrictions

Android Studio can install and launch the app through ADB. Attaching a debugger requires a debuggable application or another build and policy configuration that permits debugging.

There is no universal ADB Server Burst Mode setting

Use current Android Studio and SDK Platform Tools, reduce unnecessary deployment size, and expect internet latency to affect installs, log streaming, and debugger responsiveness. If the device does not appear, check adb devices -l, restart the ADB server if necessary, and reopen the target-device menu.

Common ADB Commands for Remote Debugging

TaskADB Command
Connect to the tunneladb connect <PUBLIC_HOST>:<PUBLIC_PORT>
List connected devicesadb devices -l
Install an APKadb -s <SERIAL> install myapp.apk
Reinstall while retaining application data when permittedadb -s <SERIAL> install -r myapp.apk
Uninstall an applicationadb -s <SERIAL> uninstall com.example.myapp
View logsadb -s <SERIAL> logcat
Clear the logcat buffers when permittedadb -s <SERIAL> logcat -c
Open a shelladb -s <SERIAL> shell
Push a fileadb -s <SERIAL> push local.txt /sdcard/
Pull a fileadb -s <SERIAL> pull /sdcard/file.txt ./
Take a screenshotadb -s <SERIAL> exec-out screencap -p > screen.png
Record the screenadb -s <SERIAL> shell screenrecord /sdcard/video.mp4
Reboot the device when permittedadb -s <SERIAL> reboot
Disconnectadb disconnect <PUBLIC_HOST>:<PUBLIC_PORT>

Security: Protecting an ADB Tunnel

Internet-reachable ADB is a high-risk administrative interface

ADB provides a privileged debugging shell and can install applications, modify many device settings, capture logs, transfer accessible files, and reboot a device. On normal production Android builds, the ADB shell is not automatically root and cannot freely read every application's private sandbox. Even without root, its capabilities are sensitive enough that a public endpoint must be tightly restricted.

🔒 Verify ADB host-key authorization

Android devices that enforce secure ADB normally require the user to approve a debugging host key. Check the displayed fingerprint and reject unexpected prompts. Do not assume this approval dialog replaces network access controls.

🌐 Use IP allowlisting when available

Allow only trusted source IP addresses or ranges. This reduces unsolicited connection attempts before they reach the ADB listener. Availability can vary by plan, so verify the current Localtonet dashboard and pricing information.

⏱ Stop the tunnel after the session

Disconnect ADB, stop the Localtonet tunnel, and confirm that it is no longer running. A saved tunnel configuration is not active unless its selected client is connected and the tunnel has been started.

🚫 Disable debugging when it is not needed

Turn off USB debugging or revoke debugging authorizations after the work is complete, particularly before returning a device to normal use.

📱 Use dedicated test devices

Do not expose ADB on personal devices or devices containing production credentials, customer data, financial applications, authentication secrets, or regulated information. For fleets and unattended production equipment, use supported enterprise device-management and remote-support controls instead of leaving ADB publicly reachable.

🧭 Follow organizational policy

Only connect to devices and networks you own or are authorized to administer. Corporate egress controls, mobile-device policies, and application-security requirements still apply.

Platform-Specific Notes

Windows

Windows

Android Studio includes SDK Platform Tools. For command-line use without Android Studio, download the current package from Android Developers. The initial USB connection may require the Google USB Driver for supported Google devices or an OEM-provided driver for another manufacturer.

adb version
adb devices -l
adb tcpip 5555
adb connect <PUBLIC_HOST>:<PUBLIC_PORT>

macOS

macOS

Android Studio can manage SDK Platform Tools through its SDK Manager. A third-party package manager may also package ADB, but ensure the installed version remains current and avoid running multiple ADB servers from conflicting installations.

adb version
adb devices -l
adb tcpip 5555
adb connect <PUBLIC_HOST>:<PUBLIC_PORT>

Linux

Linuxudev

Use Android Studio's SDK Manager, the official Platform Tools archive, or a maintained distribution package. Linux USB access may require correctly configured udev rules and group membership. Prefer documented udev configuration over running the ADB server as root.

# Package names vary by distribution
adb version
adb devices -l
adb tcpip 5555
adb connect <PUBLIC_HOST>:<PUBLIC_PORT>

Troubleshooting

ProblemLikely causeFix
adb devices shows nothing over USBUSB debugging, cable, USB mode, permissions, or driver problemUnlock the device, verify USB debugging, use a data cable, and install the correct Windows driver or Linux udev rules.
Device is unauthorizedThe host key has not been approvedInspect the device prompt and approve only the expected fingerprint. Revoke debugging authorizations and reconnect if the trusted prompt is stuck.
adb connect reports connection refusedADB is not listening, the tunnel is stopped, or the local target is wrongVerify adb tcpip 5555, confirm 127.0.0.1:5555 is configured, and start the tunnel while the Android client is connected.
Connection times outEndpoint blocked, client offline, allowlist mismatch, or unstable networkCheck the Android client's connection, source-IP rules, current public host and port, and local network egress policy.
Device appears offlineStale ADB transport or interrupted tunnelRun adb disconnect, then reconnect. If necessary, run adb kill-server and verify TCP mode again.
Android Studio does not show the deviceDifferent ADB installations or an unauthorized transportCheck adb devices -l using Android Studio's Platform Tools, close conflicting ADB servers, and reopen the device selector.
TCP mode no longer works after restartThe device returned to its normal ADB configurationReconnect through USB, authorize the computer, and run adb tcpip 5555 again.
The tunnel stops in the backgroundAndroid battery or background-process restrictionsKeep the Localtonet client active as permitted by the device and organization. Check manufacturer-specific battery settings without disabling broader security controls unnecessarily.

Frequently Asked Questions

Can I use ADB over the internet without router port forwarding?

Yes. A running Localtonet TCP tunnel uses an outbound client connection and provides a public host and port, so inbound router port forwarding and a static public IP are not required. The Android client must remain connected, the tunnel must be running, and local or corporate egress rules can still block the connection.

What port does legacy ADB over TCP use?

adb tcpip 5555 configures port 5555, which is conventionally used for this legacy workflow. The Localtonet public port is separate and is shown by the dashboard. Android 11 Wireless Debugging uses a different pairing and connection process.

Does ADB TCP mode always reset after reboot?

Many production devices return to their normal debugging configuration after reboot, but exact behavior is implementation-dependent. Verify the listener after every restart and be prepared to authorize USB again and rerun adb tcpip 5555.

Is the ADB connection end-to-end encrypted by a standard TCP tunnel?

Do not assume so. Localtonet documents an encrypted outbound tunnel from its client to the relay, but a raw public TCP endpoint is not automatically a TLS session between the remote ADB client and the endpoint. Legacy ADB host-key authorization is important, but it should not be represented as complete transport encryption. Use allowlisting when available, trusted networks, short-lived sessions, and an additional private authenticated network layer when end-to-end protection is required.

Does ADB provide root access or access to every application's data?

No, not on a normal production build. The ADB shell runs under a privileged shell identity but is not automatically root, and Android application sandboxes restrict access to private app data. Rooted, engineering, userdebug, vulnerable, or specially managed devices can behave differently. ADB remains a powerful administrative interface and must still be protected carefully.

Can I install an APK through the tunnel?

Yes, when the device and its policy permit installation. Package signatures, downgrade protection, storage availability, user restrictions, Play Protect, and enterprise-management controls still apply. Transfer time depends on latency and available bandwidth at both ends.

Does this use Android 11 Wireless Debugging?

No. This article uses the older adb tcpip workflow with a known local TCP port. Android 11 Wireless Debugging uses pairing, TLS, and separate service ports. Although ADB can support manual pairing and connection by address, forwarding that workflow requires handling the correct pairing and connection ports and is not covered by this single-port guide.

Quick Reference: Full Setup Checklist

#StepWhereCommand or action
1Enable Developer OptionsAndroid deviceUse the manufacturer-specific Build number procedure
2Enable USB debuggingAndroid deviceDeveloper Options → USB debugging
3Authorize the USB hostDevice and computerVerify the fingerprint, then run adb devices -l
4Enable legacy TCP modeComputer terminaladb tcpip 5555
5Install and authenticate LocaltonetAndroid deviceUse the device-specific AuthToken and keep it secret
6Create the TCP tunnelLocaltonet dashboardTarget 127.0.0.1:5555
7Restrict accessTunnel settingsEnable IP allowlisting when available for the plan
8Start the tunnelCurrent Localtonet controlsConfirm the Android client and tunnel are connected
9Connect ADBAuthorized computeradb connect <PUBLIC_HOST>:<PUBLIC_PORT>
10Close the session safelyBoth endsDisconnect ADB, stop the tunnel, and disable debugging when finished

Connect to an Authorized Android Test Device

Create a temporary TCP tunnel without inbound router port forwarding, then protect the ADB endpoint with host-key verification, available access controls, and a short tunnel lifetime.

Get Started Free →

Corrections & updates

Substantive changes approved by the Localtonet editorial team are listed transparently below.

Wrapped the article in the required article structure; replaced hardcoded relay examples with public endpoint placeholders; corrected ADB privilege and application-data claims; clarified that a standard TCP tunnel is not automatically end-to-end TLS; qualified reboot, Android-version, corporate-firewall, and background-persistence behavior; distinguished legacy adb tcpip from Android 11 Wireless Debugging; noted that IP allowlisting can depend on plan availability; removed the unsupported ADB Server Burst Mode recommendation and obsol

Localtonet is a secure multi-protocol tunneling and proxy platform designed to expose localhost, devices, private services, and AI agents to the public internet supporting HTTP/HTTPS tunnels, TCP/UDP forwarding, mobile proxy infrastructure, file server publishing, latency-optimized game connectivity, and developer-ready AI agent endpoint exposure from a single unified control plane.

support