Thursday, February 9, 2023

Android Wireless Debugging (Flutter + Windows + VsCode)



source link 

  • Switch on developer mode on the phone
    • Goto settings -> About phone -> clink multiple times on build number -> developer mode will be turned on
  • Then switch on debug via Wifi
    • Check the IP and port of the phone and note it down (it should be at Debug via the wi-fi button)
    • In my case 192.168.1.17:37671
  • Goto windows pc the following the location
    • C:\Users\user-name\AppData\Local\Android\Sdk\platform-tools
  • Open cmd, then use commands
C:\Users\gamit\AppData\Local\Android\Sdk\platform-tools>adb kill-server

C:\Users\gamit\AppData\Local\Android\Sdk\platform-tools>adb tcpip 37671
error: no devices/emulators found

C:\Users\gamit\AppData\Local\Android\Sdk\platform-tools>adb connect 192.168.1.17:37451
connected to 192.168.1.17:37671

C:\Users\gamit\AppData\Local\Android\Sdk\platform-tools>

Then check the visual code, the phone should be connected automatically, then you are good to go


If wifi is diconnect later, then port ip has to recheck run above commands 
use the following in a windows batch file, only edit ip and port when need to wifi debugging 

open a text file and paste following

adb kill-server
adb tcpip 40504
adb connect 192.168.1.77:40504

save as  .bat format




No comments:

Post a Comment

LeetCode C++ Cheat Sheet June

🎯 Core Patterns & Representative Questions 1. Arrays & Hashing Two Sum – hash map → O(n) Contains Duplicate , Product of A...