A new Flutter project.
- adb (if using Wireless debugging or Android emulator)
- Add
adb
executable to your PATH variable
- Add
- Open folder in VSCode
- Click
Reopen in container
from bottom right prompt
- In a terminal inside the container, run the following command at the root of the repository
flutter-web
The application should be accessible at http://localhost:8090
Ensure developer mode is turned on and USB Debugging (Wireless Debugging for MacOS/Windows) is enabled on the mobile device.
-
Connect your android device
-
Set the connection mode to
PTP
orFile transfer / Android Auto
inside the mobile device.
- Uncomment the portions of .devcontainer/devcontainer.json related to
Linux OS Host
andUSB Debugging Support
- Open command pallete in VS Code and select
Remote-Containers: Rebuild Container
- Run the following command at the root of the repository
flutter run
Your android device and computer will need to be on the same network. Since USB passthrough cannot be accomplished on Mac and Windows, we will configure debugging over the network.
In a terminal the host machine:
- Run the following command to see the list of connected devices
adb devices
- Run the following commands to connect to the device wirelessly
adb tcpip 555 adb connect <phone ip address> adb devices
- Disconnect your android device and re-run
adb devices
to verify that the device is still connected wirelessly
Inside dev container
- Open folder in VSCode
- Click
Reopen in container
from bottom right prompt - Run the following command to see the list of connected devices
adb devices
- Run the following commands to connect to the device wirelessly
adb connect <phone ip address>:5555 adb devices
- If you get
device unauthorized
, run the following commands:adb kill-server adb connect <phone ip address>:5555 adb devices
- If you get
- Run the following command at the root of the repository
flutter run
- Uncomment the portions of .devcontainer/devcontainer.json related to
Linux OS Host
andAndroid Emulator Support
- Connect your android device
- Open command pallete in VS Code and select
Remote-Containers: Rebuild Container
- In a terminal inside the container, run the following command at the root of the repository
flutter emulators --launch flutter_emulator
- In a new terminal inside the container, run the following command at the root of the repository
flutter run
- Start your local android emulator and run the following command on the host to make the emulator accessible via the network
adb tcpip 5555
- In a terminal inside the docker container, run the following command to connect to the emulator
adb connect host.docker.internal:555
- In a terminal inside the container, run the following command at the root of the repository
flutter run