App/Flutter

[Flutter/AOS] Debug a flutter project wirelessly on a physical Android device. (MacOS)

Agrafenaaa 2023. 7. 13. 14:14

1) Download "SDK Platform tools" in Android Studio if it hasn't been installed. Open the SDK Manager in your Android Studio and apply "Android UpsideDownCakePrivacySandbox" in the [SDK Platforms] tab and "Android SDK Build-Tools 34" in the [SDK Tools] tab. Make sure to keep your Android SDK Location above the tab bar. 

You also have other options available, unlike what I did.

1-1 ) install with brew.

1-2 ) install manually using the official link -  https://developer.android.com/tools/releases/platform-tools

 

2) Enable "Wireless Debugging" on your physical Android device and refer to its ip and port information. 

 

3) Return to VSCode and install the "ADB Interface for VSCode" extension. 

 

4) Execute the command "ADB: Setup custom ADB location" and select the adb file which has been installed in the Android SDK directory. 

😮 Press "Shift + Command + ." in case that Library directory is hidden. 

 

5) Execute the command "ADB: Connect to device IP" and enter ip & port information specified to your device.

5-1) If you still encounter an error such as "command failed" or "adb: command not found", carefully set up the environmental path of your adb. 

## check the installed path. 
adb version

## open zshrc
nano ~/.zshrc

## set up the path above
export PATH="/Users/grushenka/Library/Android/sdk/platform-tools:$PATH"

## exit from it and execute
source ~/.zshrc

## recheck adb version
adb version

 

6) Done!! Just run your project once there are no problems with connection.