Install VS Code from https://code.visualstudio.com/download.
Install Flutter SDK from https://docs.flutter.dev/get-started/install
Install Android Studio from https://developer.android.com/studio?gclsrc=ds&gclsrc=ds
Flutter also provides official plugins for IntelliJ and Visual Studio Code. In case of Android Studio and IntelliJ, don’t forget to restart the IDE to activate the newly installed plugins (this is not needed for VS Code). Note that only stable versions of IDEs are supported, the Flutter plugin may not function properly on Beta, Canary, or EAP (Early Access Preview) builds.For this tutorial we will be assuming that you have flutter SDK and Android Studio installed in your system.
The Xcode installer will prompt you to install the missing components (if there are any). After a while, the simulator should appear and become available on the device menu.
Things are a little bit more complicated in the case of a physical iOS device. Assuming that the device is connected via a USB cable and unlocked (keep in mind the additional key prompt after connecting a cable), we first need to open the iOS module in Xcode:
Sign in to your Apple ID (create a new one if needed). After closing the Accounts window, provisioning profiles will be generated.
If you get an error which states that the app identifier cannot be registered like this:
It means that someone is already using your identifier. You need to change the Bundle Identifier value to something else.
After signing is configured, you can try to run the app from Android Studio. The first attempt will fail because the provisioning profile is not trusted on the device. You need to trust it in Profiles & Device Management settings:
Note that at the time of writing this article, it’s impossible to run Flutter apps provisioned using (free of charge) Personal Team provisioning profiles on devices running on iOS 13.3.1. It’s a limitation introduced by Apple. You can watch this issue to be notified about progress.
Once the profile is trusted, you can launch the app from the home screen.
In the case of a physical Android device, it needs to be connected via a USB cable and have USB debugging enabled (see how to do that in the official developer guide).
In the case of an Android emulator, we need to create a virtual device. First, let’s open the AVD manager by either using the icon on the toolbar or pressing Ctrl+Alt+F12 (Cmd+Alt+F12 on macOS) and typing the action name.
Creating an AVD is a one-off action. Once created, it will be available until explicitly removed.
Now it’s time to run our app! Choose the desired device or emulator and press Shift+F10 (Ctrl+R on macOS) or use the Run button.
-
In older versions of Android Studio, you should instead launch Android Studio > Tools > Android > AVD Manager and select Create Virtual Device…. (The Android submenu is only present when inside an Android project.)
-
If you do not have a project open, you can choose Configure > AVD Manager and select Create Virtual Device…
Step 4: Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image is recommended.
Step 7: In Android Virtual Device Manager, click Run in the toolbar. The emulator starts up and displays the default canvas for your selected OS version and device.
First, log in with your Google account to manage your Firebase projects. From within the Firebase dashboard, select the Create new project button and give it a name:
If you choose to use Google Analytics, you will need to review and accept the terms and conditions prior to project creation.
After pressing Continue, your project will be created and resources will be provisioned. You will then be directed to the dashboard for the new project.
In your project dashboard,click on the flutter icon.
Now follow all the steps mentioned in this page,
This automatically registers your per-platform apps with Firebase and adds a lib/firebase_options.dart
configuration file to your Flutter project.
Note:Make sure you login to your firebase account while you initialise firebase_cli in your terminal.
There are additional steps for installing the Firebase SDK and adding initialization code, but they are not necessary for this tutorial.
Step 1: Open the command palette in VS Code using the shortcut ctrl+shift+P or selecting it in the 'View' Dropdown Menu.
Step 3: Once the Flutter Emulator is active,you can launch the Android App from the "main.dart" file by running the following command in the Terminal.
flutter run --no-sound-null-safety
flutter pub get
That’s it! Have a great day!