Flutter SDK On Mac
[1]. Get the Flutter SDK
Download the following installation bundle to get the latest stable release of the Flutter SDK:
flutter_macos_1.17.5-stable.zip
For other release channels, and older builds, see the SDK archive page.
Extract the file in the desired location, for example:
If you don’t want to install a fixed version of the installation bundle, you can skip steps 1 and 2. Instead, get the source code from the Flutter repo on GitHub with the following command:
$git clone https://github.com/flutter/flutter.git
https://flutter.dev/docs/development/tools/sdk/releases?tab=macos
You can also change branches or tags as needed. For example, to get just the stable version:
$git clone https://github.com/flutter/flutter.git -b stable --depth 1
Add the flutter tool to your path:
$export PATH="$PATH:`pwd`/flutter/bin"
$flutter precache
$sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
$sudo xcodebuild -runFirstLaunch
Download and install Android Studio.
Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDK Command-line Tools, and Android SDK Build-Tools, which are required by Flutter when developing for Android.
To prepare to run and test your Flutter app on the Android emulator, follow these steps:
Enable VM acceleration on your machine.
Launch Android Studio > Tools > Android > AVD Manager and select Create Virtual Device. (The Android submenu is only present when inside an Android project.)
Choose a device definition and select Next.
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.
Under Emulated Performance, select Hardware - GLES 2.0 to enable hardware acceleration.
Verify the AVD configuration is correct, and select Finish.
For details on the above steps, see Managing AVDs.
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.
$ flutter channel beta
$ flutter upgrade
$ flutter config --enable-web
#Add web support to an existing project
[5]. Check Install
$flutter doctor
[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.13.6 17G14019, locale en-VN)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] iOS toolchain - develop for iOS devices (Xcode 9.1)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.48.2)
[✓] Connected device (1 available)
Comments
Post a Comment