Skip to content

Latest commit

 

History

History
93 lines (63 loc) · 3.31 KB

usefull-commands.md

File metadata and controls

93 lines (63 loc) · 3.31 KB

Usefull VSCode and Flutter CLI operations

Usefull VSCode commands

Command-Shift-P > Dart: Open DevTools Network Page
Command-Shift-P > Dart: Restart Analysis Server

Usefull CLI operations

environment info listing

echo $FLUTTER_HOME/bin/cache/artifacts
ll $FLUTTER_HOME/bin/cache/artifacts
rm -rf $FLUTTER_HOME/bin/cache/artifacts
flutter doctor -v
which flutter

clean and rebuild

flutter clean
flutter pub get
flutter run

unit tests, widget and integration tests, e2e

flutter test -r expanded
flutter test -r expanded test/features/game/letter.widget_test.dart
flutter test integration_test/app_test.dart
flutter test integration_test

Steps to see test coverage of the project:

# Generate code coverage (will be located at 'coverage/lcov.info')
flutter test --coverage

# Generate html for test coverage
# You will need to have lcov installed (`sudo apt install lcov`, `brew install lcov`)
genhtml coverage/lcov.info -o coverage/html

# Open the html that's generated
open coverage/html/index.html

If you want to see test coverage in vscode, take a look at following extensions that can help you out:

Start headless android emulator before running e2e tests

emulator -list-avds
emulator -avd  Pixel_5_API_29 -no-audio -no-window

Kill android emulator

adb kill-server
adb emu kill

If that's not enough, from Android Studio on the AVD panel, go to the down arrow and click on the "Show on Disk". You will get the list of all files, then remove the files "*.lock"

Mockito re-generate .g.dart mocks files

flutter pub run build_runner build
flutter pub run build_runner build --delete-conflicting-outputs

MobX re-generate .g.dart store files

flutter packages pub run build_runner build

Start Flutter app on Simulator or a specific device

open -a Simulator
xcrun simctl list
flutter devices
flutter run -d "iPhone 13"
flutter run -d "SM A505W"