A comprehensive guide for connecting your Android device to your development machine for Flutter development.
Before starting, ensure you have:
- Flutter SDK installed and configured
- Android Studio with Android SDK
- USB drivers for your Android device
- Both devices connected to the same Wi-Fi network (for wireless debugging)
- Go to
Settings→About Phone - Tap
MIUI version7 times until you see "You are now a developer!" - Navigate to
Settings→System→Developer Options - Toggle ON
Developer Options
Method 1: USB Debugging (All Android Devices)
- Enable Developer Options (as shown above)
- Turn on
USB debugging - For Android 11+: Enable
Install via USBandWireless debugging
# Enable TCP/IP mode on port 5555
adb tcpip 5555
# Find your phone's IP address
# Settings → About Phone → Status → IP address
# Or run:
adb shell ip route
# Connect to your device via Wi-Fi
adb connect <PHONE_IP_ADDRESS>:5555
# Example:
adb connect 192.168.18.48:5555
# Verify connected devices
adb devicesflutter devicesExpected output:
List of devices attached
<device_id> device
<PHONE_IP_ADDRESS>:5555 device
Run:
flutter run -d M2006C3LI
adb disconnect <PHONE_IP_ADDRESS>:5555Method 2: Wireless Debugging (Android 11+)
- Enable Developer Options
- Turn on
Wireless debugging - Note the IP address, port, and pairing code displayed on your phone
# Pair with your device
adb pair <IP_ADDRESS>:<PAIRING_PORT>
# Example:
adb pair 192.168.1.105:43127
# Connect to your device
adb connect <IP_ADDRESS>:<DEBUG_PORT>
# Example:
adb connect 192.168.1.105:5555adb devices
flutter devicesadb disconnect <IP_ADDRESS>:5555| Issue | Solution |
|---|---|
Device not showing in adb devices |
- Check USB debugging is enabled - Try different USB cable/port - Restart ADB server: adb kill-server && adb start-server |
| Connection refused errors | - Ensure both devices are on same Wi-Fi - Check firewall settings |
| Wireless debugging not working | - Verify Android 11+ on device - Restart wireless debugging |
| IP address changes frequently | - Set static IP on router - Check IP before connecting |
- Method 1:
Settings→About Phone→Status→IP address - Method 2: Connect via USB and run:
adb shell ip route - Method 3:
Settings→Wi-Fi→ Tap connected network → View IP address
- Create aliases or scripts to automate the connection process
- Default ADB port is 5555 for wireless connections
- Only enable wireless debugging on trusted networks
- Keep USB cable handy as backup
- Wireless debugging requires Android 11 or higher
- USB connection is recommended for initial setup
- Settings may vary by manufacturer (MIUI, OxygenOS, etc.)
- Always disconnect properly to avoid future connection issues
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
⭐ Found this helpful? Star this repository!