Documentation Index
Fetch the complete documentation index at: https://mintlify.com/zwc456baby/ScrcpyForAndroid/llms.txt
Use this file to discover all available pages before exploring further.
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)
Connection Methods
Local Network Connection
The most common way to connect is over a local Wi-Fi network:- Find the IP address of the target device (usually in Settings > About Phone > Status)
- Enter the IP address in the “Remote Device IP address” field
- Click “Start” to initiate the connection
Public Network Connection
For connections over the internet, you need to specify the public IP and port: 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
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:- ADB Connect: App executes
adb connect <ip>:<port> - Server Upload: Copies
scrcpy-server.jarto/data/local/tmp/on target device - Port Forward: Sets up local port forwarding:
tcp:7008→tcp:7007 - Server Start: Launches the scrcpy server with configured resolution and bitrate
- 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
Testing Connection
To verify your connection setup:- Use the local loopback address
127.0.0.1to test the app functionality - Check the connection history dropdown - it should show at least the loopback address
- 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
