|
|
2 months ago | |
|---|---|---|
| .devcontainer | 1 year ago | |
| dev-init | 1 year ago | |
| sample_projects | 1 year ago | |
| .gitignore | 1 year ago | |
| Dockerfile | 1 year ago | |
| LICENSE | 1 year ago | |
| README.md | 2 months ago | |
| docker-compose.yml | 2 months ago | |
| entrypoint.sh | 1 year ago | |
README.md
Build and configure
Run docker compose build to build the dev container. Then inside the container run selected init scripts. E.g.:
bash /opt/dev-init/dev-init-flutter.sh
bash /opt/dev-init/dev-init-rust.sh
bash /opt/dev-init/dev-init-android.sh
You can skip building the image by pulling chodak166/dev-flutter.
Android SDK, gradle, flutter, rust and vscode data should be preserved as configured in compose file. The /opt/dev-init/dev.env file is also used by docker compose to setup environment variables. See docker-compose.yml and .devcontainer/docker-compose.yml for details.
Compile and debug the app
Use flutter create or sample projects in /opt/sample_projects to perform first build and make gradle download dependencies. Then use flutter run to run the app.
Run and debug in VSCode
With .devcontainer present in root project just run 'Reopen in container' command (ctrl+shift+p) or run dev-flutter-01 manually with:
docker compose run --name dev-flutter-01 -d dev-flutter
After connecting to the container install flutter and dart tools (dart-code.flutter and dart-code.dart-code). Installing toroxx.vscode-avdmanager is also recommended for AVD management.`
AVD UI, flutter commands, dev tools and debug tools should be available from your IDE.
Run and debug USB device
The fluter devices command should identify all connected USB devices along with emulators and system targets with no problem. E.g.:
$ flutter devices
Found 5 connected devices:
Armor 3 (mobile) • 3060MF1001017685 • android-arm64 • Android 8.1.0 (API 27)
BV7100 (mobile) • BV7100EEA0015872 • android-arm64 • Android 12 (API 31)
sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 14 (API 34) (emulator)
Linux (desktop) • linux • linux-x64 • Debian GNU/Linux 12 (bookworm) 5.15.0-125-generic
Chrome (web) • chrome • web-javascript • Google Chrome 131.0.6778.85
export ADB_TRACE=info
In case of any issues try adb kill-server and then adb start-server. Run export ADB_TRACE=all to see verbose output.
You can also check open 5037 port with fuser 5037/tcp and kill it with -k. So on host machine try:
fuser -k 5037/tcp
adb start-server
Targeting Android SDK versions
See /opt/dev/init/dev-init-android.sh for default SDK and build tools versions. Use sdkmanager or AVD magager to install other SDKs, emulators and build tools.
Avoid changing build.gradle and other config files when flutter variables are used. Edit android/local.properties file instead. Example content:
flutter.sdk=/opt/flutter
flutter.compileSdkVersion = 34
flutter.targetSdkVersion = 23
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
sdk.dir=/opt/android-sdk
Note that you can use new compile SDK and build tools to target older API.