Skip to content

Instantly share code, notes, and snippets.

@Rockncoder
Last active September 13, 2024 18:36
Show Gist options
  • Save Rockncoder/a7aa6fb482b427174f767ac30785ec6e to your computer and use it in GitHub Desktop.
Save Rockncoder/a7aa6fb482b427174f767ac30785ec6e to your computer and use it in GitHub Desktop.
macOS Flutter Setup

MacOS Flutter Setup with Brew

  • Tools

    • Xcode
      • sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
      • sudo xcodebuild -runFirstLaunch
      • sudo gem install cocoapods
      • might need this too:
        • sudo gem install activesupport -v 6.1.7.6
    • Android Studio
      • export ANDROID_NDK_HOME="/opt/homebrew/share/android-ndk"
  • ~/.zshrc or ~/.zprofile

    • In general I prefer to make changes to ~/.zprofile since it only affects your user instance
  • Installing Homebrew and some useful tools

    • /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    • (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/troy.miles/.zprofile
    • eval "$(/opt/homebrew/bin/brew shellenv)"
    • brew install git
    • brew install awscli
    • brew install aws-cdk
    • brew install k6
    • brew install node@18
    • brew install openjdk@11
    • brew install --cask iterm2
    • brew install --cask visual-studio-code
    • brew install --cask postman
    • brew install --cask intellij-idea
    • brew install --cask android-studio
  • Pointing to the right git

    • Apple puts an old version of Git on all Macs.
    • Luckily, through path magic we can install a git using brew and place it ahead of Apple’s version in the path chain.
    • Add the following to ~/.zprofile
      • alias git='/opt/homebrew/bin/git'
      • The line above will force the git command to use home-brew’s git
  • Hiding (and showing) Desktop icons

    • Disable
      • defaults write com.apple.finder CreateDesktop false
      • killall Finder
    • Enable
      • defaults write com.apple.finder CreateDesktop true
      • killall Finder
  • Configure SSH and adding to GHE

    • mkdir .ssh
    • cd .ssh
    • ssh-keygen -t ed25519 -C ""
      • (no passphrase)
      • ssh-add ~/.ssh/id_ed25519
    • config file
      • touch config
      • open config
      • fill with:
        • Host HOSTNAME
        • AddKeysToAgent yes
        • IdentityFile ~/.ssh/id_ed25519
  • Configuring Git

    • https://www.freecodecamp.org/news/setup-git-on-mac/
    • git config --global user.name ""
    • git config --global user.email ""
    • git config --global core.editor code
    • git config --global color.ui true
    • git config --list
      • credential.helper=osxkeychain
      • user.name=
      • user.email=
      • core.editor=code
      • color.ui=true
  • GitHub SSH

    • mkdir source; cd source
    • git clone
  • Test base development systems

    • Build an Android app -> deploy to device
    • Build an iOS app -> deploy to device
  • Install Flutter

    • make sure Rosetta is available
      • sudo softwareupdate --install-rosetta --agree-to-license
    • install Flutter zip from flutter.dev
    • sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    • sudo xcodebuild -runFirstLaunch
    • Install cocoapoods
      • sudo gem install cocoapods
      • sudo gem install activesupport -v 6.1.7.6
    • install FVM
      • brew tap leoafarias/fvm
      • brew install fvm
    • flutter doctor
      • Doctor summary (to see all details, run flutter doctor -v):
      • [✓] Flutter (Channel stable, 3.13.6, on macOS 14.0 23A344 darwin-arm64, locale en-US)
      • [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
      • [✓] Xcode - develop for iOS and macOS (Xcode 15.0)
      • [✓] Chrome - develop for the web
      • [✓] Android Studio (version 2022.3)
      • [✓] IntelliJ IDEA Ultimate Edition (version 2023.2.2)
      • [✓] VS Code (version 1.82.2)
      • [✓] Connected device (3 available)
      • [✓] Network resources
  • Don’t forget to add your team’s information to Xcode

    • set your bundle identifier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment