Skip to content

Instantly share code, notes, and snippets.

@mikesparr
Last active December 7, 2022 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikesparr/41f2673bdfe2fb568713f70c1782f446 to your computer and use it in GitHub Desktop.
Save mikesparr/41f2673bdfe2fb568713f70c1782f446 to your computer and use it in GitHub Desktop.
Flutter setup steps for Mac running Apple silicon
#! /usr/bin/env bash
#############################################################
# REFERENCES
# - https://docs.flutter.dev/get-started/install/macos
# - https://developer.android.com/studio/index.html
# - https://developer.android.com/studio/command-line
# - https://developer.android.com/studio/command-line/sdkmanager
# - https://developer.apple.com/download/
# - https://guides.cocoapods.org/using/getting-started.html#installation
#############################################################
# enable rosetta for apple silicon macs
sudo softwareupdate --install-rosetta --agree-to-license
# install flutter using homebrew
brew install flutter
# check for dependencies
flutter doctor
# install java (android studio dependency)
brew install java
# download android command-line tools and add to path (moving into sdk folder)
# unzip <cmdline-tools-zip-file>
mv cmdline-tools ~/Library/Android/sdk/
cd ~/Library/Android/sdk/cmdline-tools
mkdir -p latest
mv lib bin source.properties NOTICE.txt latest/
export PATH="~/Library/Android/sdk/cmdline-tools/latest/bin:$PATH" >> .zshrc
sdkmanager --install "cmdline-tools;latest"
# install xcode tools (after download XCode from AppStore)
sudo xcodebuild -license
sudo xcodebuild -runFirstLaunch
# install cocoapods (installs ruby dependency)
brew install cocoapods
# after all dependencies are met, flutter doctor will build the tool
flutter doctor
# Building flutter tool...
# Doctor summary (to see all details, run flutter doctor -v):
# [✓] Flutter (Channel stable, 3.3.9, on macOS 13.0.1 22A400 darwin-arm, locale en-US)
# [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
# [✓] Xcode - develop for iOS and macOS (Xcode 14.1)
# [✓] Chrome - develop for the web
# [✓] Android Studio (version 2021.3)
# [✓] VS Code (version 1.73.1)
# [✓] Connected device (2 available)
# [✓] HTTP Host Availability
# • No issues found!
# --------------- test it out on IOS simulator --------------------
# run simulator
open -a Simulator
# create and run simple flutter app
flutter create my_app
cd my_app
flutter run
# hooray
# --------------- test it out on Android simulator ----------------
# https://docs.flutter.dev/get-started/install/macos#android-setup
@mikesparr
Copy link
Author

Results

Screenshot 2022-12-07 at 2 35 52 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment