Flutter App Testing over Network sans USB Connection
You can run or test your Flutter application either in a real device or on a emulated device. I personally prefer running in a real device as it’s more faster than its emulated counterpart.
If you are a fan of using real device(like me), it’s very common to connect your physical device to your computer using an USB cable. Although it is more efficient and fast, we can make it more efficient by connecting our real device to the computer over the wireless network. Wires Free.
Let’s see on the steps now.
Since you are working in Flutter, it should be obvious that Developer Mode is enabled in your Android device. Once you go to the “Developer Options” in your Android Settings, you can find a section called “ADB over Network”.
When you enable this option, you can see that it display’s an IP address. We are going to connect to this IP to enable wireless connection.
In a command prompt, we can use adb connect
command to establish an connection.
Once the connection is successful you can notice that your IDE of choice is able to recognize your mobile device.
Great. You can now run and test your Flutter app as you would do normally via USB cable connection.
TIPS:
Some custom Android ROMs like LineageOS provide you an option to add a quick shortcut for enabling the “ADB over Network”. By this way, you do not have to navigate several screens to enable it.
I hope you like this post, and leave a few claps if you did. Please share your thoughts, suggestions, or any feedback about this post.