Skip to content

natesitton80/vscode-flutter-dev-container

Repository files navigation

Learn Flutter!

A new Flutter project.

Table of Contents

Requirements

MacOS/Windows

Emulation

Getting Started

  1. Open folder in VSCode
  2. Click Reopen in container from bottom right prompt

Web Hosting

  1. 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

Android USB/Wireless Debugging

Ensure developer mode is turned on and USB Debugging (Wireless Debugging for MacOS/Windows) is enabled on the mobile device.

  1. Connect your android device

  2. Set the connection mode to PTP or File transfer / Android Auto inside the mobile device.

    image

Linux

  1. Uncomment the portions of .devcontainer/devcontainer.json related to Linux OS Host and USB Debugging Support
  2. Open command pallete in VS Code and select Remote-Containers: Rebuild Container
  3. Run the following command at the root of the repository
    flutter run

MacOS/Windows

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:

  1. Run the following command to see the list of connected devices
    adb devices
  2. Run the following commands to connect to the device wirelessly
    adb tcpip 555
    adb connect <phone ip address>
    adb devices
  3. Disconnect your android device and re-run adb devices to verify that the device is still connected wirelessly

Inside dev container

  1. Open folder in VSCode
  2. Click Reopen in container from bottom right prompt
  3. Run the following command to see the list of connected devices
    adb devices
  4. Run the following commands to connect to the device wirelessly
    adb connect <phone ip address>:5555
    adb devices
    1. If you get device unauthorized, run the following commands:
      adb kill-server
      adb connect <phone ip address>:5555
      adb devices
  5. Run the following command at the root of the repository
    flutter run

Android Emulator (WIP)

Linux

  1. Uncomment the portions of .devcontainer/devcontainer.json related to Linux OS Host and Android Emulator Support
  2. Connect your android device
  3. Open command pallete in VS Code and select Remote-Containers: Rebuild Container
  4. In a terminal inside the container, run the following command at the root of the repository
    flutter emulators --launch flutter_emulator
  5. In a new terminal inside the container, run the following command at the root of the repository
    flutter run

MacOS/Windows

  1. Start your local android emulator and run the following command on the host to make the emulator accessible via the network
    adb tcpip 5555
  2. In a terminal inside the docker container, run the following command to connect to the emulator
    adb connect host.docker.internal:555
  3. In a terminal inside the container, run the following command at the root of the repository
    flutter run

Resources

About

Starter Dev Container for Flutter/VSCode

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published