Before starting how to run Flutter app in MacBook using the terminal it is important to know what is Flutter?
What is Flutter?
Flutter
is a mobile app SDK for building high-performance, high-fidelity, apps for iOS and Android, from a single codebase.
The goal is to enable developers to deliver high-performance apps that feel natural on different platforms. We embrace differences in scrolling behaviors, typography, icons, and more.
Check out more about our Flutter app development services.
Below is our application developed using flutter framework
iOS
Android
No mobile development experience is required to get started. Apps are written in Dart, which looks familiar if you’ve used a language like Java or JavaScript. Experience with object-oriented languages is definitely helpful, but even non-programmers have made Flutter apps!
System requirements
To install and run Flutter
, your development environment must meet these minimum requirements:
- Operating Systems: macOS (64-bit)
- Disk Space: 700 MB (does not include disk space for IDE/tools).
- Tools: Flutter depends on these command-line tools being available in your environment.
bash
curl
git
2.xmkdir
rm
unzip
which
Get the Flutter SDK
- Download the following installation bundle to get the latest stable release of the Flutter SDK.
- Extract the file in the desired location, for example:
12$ cd ~/development$ unzip ~/Downloads/flutter_macos_v1.7.8+hotfix.4-stable.zip - Add the
flutter
tool to your path:
1$ export PATH="$PATH:`pwd`/flutter/bin"This command sets your
PATH
PATH
variable for the current terminal window only. - Optionally, pre-download development binaries:The
flutter
tool downloads platform-specific development binaries as needed. For scenarios where pre-downloading these artifacts is preferable (for example, in hermetic build environments, or with intermittent network availability), iOS and Android binaries can be downloaded ahead of time by running:1$ flutter precache - You are now ready to run Flutter commands!
Run flutter doctor
Run the following command to see if there are any dependencies you need to install to complete the setup (for verbose output, add the -v
flag):
1 |
$ flutter doctor |
This command checks your environment and displays a report to the terminal window. The Dart SDK is bundled with Flutter; it is not necessary to install Dart separately. Check the output carefully for other software you might need to install or further tasks to perform (shown in bold text).
If everything is correct then the terminal look like this.
Set up the iOS simulator
To prepare to run and test your Flutter app on the iOS simulator, follow these steps:
- On your Mac, find the Simulator via Spotlight or by using the following command:
1$ open -a Simulator - Make sure your simulator is using a 64-bit device (iPhone 5s or later) by checking the settings in the simulator’s Hardware > Device menu.
- Depending on your development machine’s screen size, simulated high-screen-density iOS devices might overflow your screen. Set the device scale under the Window > Scale menu in the simulator.
Create and run a simple Flutter app
To create your first Flutter app and test your setup, follow these steps:
- Create a new Flutter app by running the following from the command line:
1$ flutter create dummy_app - A
dummy_app
directory is created, containing Flutter’s starter app. Enter this directory:
1$ cd dummy_app
You can also run any exiting application by setting the project path
1$ cd "exiting_flutter_app_path" - To launch the app in the Simulator, ensure that the Simulator is running and enter:
1$ flutter run