Skip to main content

Overview

Scrcpy for Android allows you to mirror and control another Android device from your phone. This guide covers the different connection methods available.

Prerequisites

Before connecting, ensure:
  • Wireless debugging is enabled on the target device
  • ADB is configured on the target device
  • Both devices are on the same network (for local connections)
Run adb tcpip 5555 on your target device to reset the ADB port to the default port.

Connection Methods

Local Network Connection

The most common way to connect is over a local Wi-Fi network:
  1. Find the IP address of the target device (usually in Settings > About Phone > Status)
  2. Enter the IP address in the “Remote Device IP address” field
  3. Click “Start” to initiate the connection
192.168.0.73

Public Network Connection

For connections over the internet, you need to specify the public IP and port:
Ensure port forwarding is configured on your router to forward the ADB port (default: 5555) to your target device.
Required Ports:
  • ADB Port: 5555 (default, can be customized)
  • Local Forward Port: 7008 (used internally for video/audio streaming)
  • Server Socket Port: 7007 (used for communication)

IPv6 Support

Scrcpy for Android supports IPv6 addresses. When using IPv6:
IPv6 Format
[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:5555
IPv6 addresses should be enclosed in square brackets when specifying a port.

Connection History

The app automatically saves your connection history for quick access:
  • Up to 30 devices are stored in history
  • Most recent connections appear first
  • Tap the history icon next to the IP field to view saved addresses
  • History is preserved between app sessions
Connection history is not saved when using headless mode.

ADB Connection Process

When you initiate a connection, the following steps occur:
  1. ADB Connect: App executes adb connect <ip>:<port>
  2. Server Upload: Copies scrcpy-server.jar to /data/local/tmp/ on target device
  3. Port Forward: Sets up local port forwarding: tcp:7008tcp:7007
  4. Server Start: Launches the scrcpy server with configured resolution and bitrate
  5. Socket Connection: Establishes TCP connection to 127.0.0.1:7008

Connection Timeout

The app implements intelligent timeout handling:
  • Initial connection attempts: 50 attempts with 100ms intervals (5 seconds total)
  • Socket connection timeout: 5000ms (5 seconds)
  • Resolution handshake: Up to 1 second to receive device resolution
  • Overall timeout: If connection isn’t established, you’ll see “Connection Timed out 2”

Reconnection

If the connection drops:
  • The app prompts you to retry the connection
  • Previous settings (resolution, bitrate) are preserved
  • After 3 failed connection attempts, the ADB server automatically restarts
If you’re experiencing repeated connection failures, try manually disconnecting and reconnecting in ADB, or restart wireless debugging on the target device.

Testing Connection

To verify your connection setup:
  1. Use the local loopback address 127.0.0.1 to test the app functionality
  2. Check the connection history dropdown - it should show at least the loopback address
  3. Monitor the connection status message - successful connections show the remote screen within seconds

Next Steps

Configuration

Customize resolution, bitrate, and other settings

Troubleshooting

Solve common connection issues

Build docs developers (and LLMs) love