https://developer.android.com/tools/adb#wireless-adb-android-11
To install and set up Android Debug Bridge (adb) for debugging a Flutter application on your mobile phone, follow these steps:
Download and Install Android Studio: Download Android Studio from the official Android developer website
https://developer.android.com/studio
Install Android SDK: During the installation, ensure that the Android SDK is installed
We press in the three dots button and we select the option SDK Manager
We have to select the SDK Tools tab and then install Android SDK Command-Line Tools
Open Android Studio:
Launch Android Studio and go to the SDK Manager
Navigate to Configure > SDK Manager
Install SDK Platform Tools:
In the SDK Manager, go to the SDK Tools tab
Check the box for Android SDK Platform-Tools
Click OK to install the package
Find adb Location:
The adb executable is located in the platform-tools directory inside the Android SDK directory
Common default paths:
Windows: C:\Users<Your-Username>\AppData\Local\Android\Sdk\platform-tools
macOS: ~/Library/Android/sdk/platform-tools
Linux: ~/Android/Sdk/platform-tools
Add to PATH:
Windows:
Open Control Panel > System and Security > System > Advanced system settings
Click on Environment Variables
Under System variables, find the Path variable, and click Edit
Click New and add the path to the platform-tools directory
Click OK to save the changes
C:\Users\luisc\AppData\Local\Android\Sdk\platform-tools
We first press the Settings button
We select the menu option Settings/About the Phone
Then we select the option Software Information
For enabling the Develper options we have to tap on the Build Number sevent times:
We enter the Mobile device password if required
We receive a message Developer mode has been turned on
Now we can verify the Developer options are available in our mobile phone:
We can Enable USB Debugging:
Go to Settings > System > Developer options
Enable USB debugging
We also have to connect the Mobile to the Laptop with an USB wire
We can also revoke the USB debugging authorization for detecting the mobile phone
And then accept the message in your mobile phone to authorize to connect the mobile to the laptop
Connect Your Phone:
Connect your Android phone to your computer using a USB cable
Verify adb Connection:
Open a terminal (Command Prompt on Windows, Terminal on macOS/Linux)
Run the following command:
adb devices
You should see your device listed. If prompted on your phone, authorize the connection
Open your Flutter project
Run the Flutter application:
In the terminal, navigate to your Flutter project directory
Run the following command to start debugging on your connected device:
flutter run
We click on the new flutter application icon in our mobile device to run it
Your Flutter application should now be running on your mobile phone, and you can use adb for debugging purposes