DJI Android App Wi-Fi Debug
How to debug an Android app while the USB of your mobile device is busy?
Why is that even a problem?
The deal is… I really want to test the flight of a DJI drone through an Android virtual controller before crashing it into a wall.
The situation is… The communication between the app and the real DJI RC is maintained through a USB connection.
The problem is… To use the Android Studio IDE debug tools, a connection with the device running the app is mandatory.
What’s the solution?
Since the USB connection is out of the equation, let’s change the paradigm to wireless technologies.
The possible solutions to solve this matter are Wi-Fi and Bluetooth, being the first the most common alternative.
To establish a Wi-Fi connection between your Android device and the PC, follow the next steps.
1. Install the ADB drivers on your PC and connect your device to the PC via USB
2. Connect your device to the same Wi-Fi network as your PC
3. Open a shell terminal on your PC and type the following command
adb shell ip addr
4. Check the wlan0 interface to learn the IP address (e.g. 192.168.1.80)
5. Type the following command for the target device to listen for a TCP/IP connection on port 5555
adb tcpip 5555
6. Remove the USB cable and establish a Wi-Fi connection with your target device by typing the following command. Change the ip and port values for yours.
adb connect 192.168.1.80:5555
Now you can see your device listed to run the app in the Android Studio IDE.
Extra
To change the connection port, you need to reset the adb server by typing the following command.
adb kill-server
Happy debugging! 💻