To disable reporting of telemetry:
- flutter config --no-analytics; flutter --disable-analytics
To run various checks on Flutter:
- flutter doctor
- flutter doctor -v
- flutter doctor --android-licenses
Create a new app:
- flutter create my_new_app_name
Run a Flutter app to try it out as a Linux application:
This command enables Linux as a target platform for building Flutter applications.
- flutter config --enable-linux-desktop
- flutter run
- flutter run --debug
This command builds a release version in Linux:
- flutter build linux --release
Clean the build:
- flutter clean
Add dependencies to pubspec.yaml:
- flutter pub add <package_name>
Add development dependencies:
- flutter pub add <package_name> --dev
Download all the dependencies specified in pubspec.yaml:
- flutter pub get
Build an APK for Android with multiple APK's for different platforms bundled into one APK:
This command ends up creating a much bigger APK than necessary.
- flutter build apk
Build separate APK files for each platform:
- flutter build apk --split-per-abi --release
View what emulated devices are available:
- flutter emulators
Start an emulated device:
Search for the names with underscores. Those are the ones you can use to run a specific emulator. For example, a name like Large_Desktop_API_33 or Medium_Tablet_Edited_API_34 or Pixel_3a_API_34
- flutter emulators --launch <emulated device name>
View what emulated devices are running now:
Search for emulated device id's which look like emulator-5554 as an example. Those are the device id's which you can use to install an APK or shutdown the emulator etc.
- flutter devices
- adb devices
View which architecture the emulated device has:
- adb devices -l
Install the APK into a device and run:
This is for installing and running the APK which has multiple APK's bundled into it. This command will uninstall any older APK that was present in the device and
- flutter install -d <emulated device id> --release
This is for installing and running the APK's which were created using the `split-per-abi` command:
- adb install path/to/file/<filename>.apk
- adb -s <emulated device id> install path/to/file/<filename>.apk
Shutdown an emulated device:
- adb -s <emulated device id> emu kill

No comments:
Post a Comment