Step 1: Ensure your device and computer are on the same network
First, ensure your Android device and the computer you're using to connect are on the same local network, such as connected to the same Wi-Fi network.
Step 2: Enable Developer Options and USB Debugging
- On your Android device, go to 'Settings'.
- Scroll down and find 'About phone', then tap 'Build Number' seven times until you see 'You are in Developer Mode'.
- Return to the Settings menu, find and enable 'Developer Options'.
- Enable 'USB debugging'.
Step 3: Connect the device via USB and authorize the computer
- Connect the Android device to the computer using a USB cable.
- If a dialog box appears asking 'Allow USB debugging?', select 'Allow' and check 'Always allow debugging from this computer'.
Step 4: Configure the device for TCP/IP connection
- Open the terminal on your computer (for Linux or Mac) or Command Prompt/PowerShell (for Windows).
- Enter
adb devicesto confirm your device is connected and recognized. - Find the device's IP address, which can be viewed in the Wi-Fi settings on the device.
- In the terminal or command prompt, enter
adb tcpip 5555. This restarts the ADB daemon and listens on port 5555.
shadb tcpip 5555
Step 5: Disconnect USB and connect via Wi-Fi
- Disconnect the USB connection.
- Connect via ADB using the device's IP address; the command format is
adb connect <device IP address>:5555.
shadb connect 192.168.x.x:5555
Step 6: Verify the connection
Enter the adb devices command; if everything is set up correctly, you should see a line like 192.168.x.x:5555 device, indicating the device is connected via Wi-Fi.
This completes the process of connecting to an Android device using ADB over TCP/IP. If the connection fails, check firewall settings or confirm the device IP address is correct. We hope this helps you complete the setup successfully.
2024年8月5日 02:12 回复