M1 Mac에서 Flutter를 설치하고 Android/iOS 개발 환경을 한 번에 구성하려면 어떻게 해야 할까요?

Flutter 는 Google이 개발한 오픈소스 UI 프레임워크로, 하나의 코드베이스로 Android, iOS, 웹, 데스크톱 앱을 동시에 개발할 수 있습니다. Dart 언어를 사용하며, Hot Reload를 통해 코드 변경 사항을 즉시 확인할 수 있습니다.

**사전 조건 **: Homebrew가 설치되어 있어야 합니다. 설치 방법은 Homebrew 설치하기를 참고해주세요.


Flutter 설치

1. Homebrew로 설치

SHELL
brew install flutter

2. 버전 확인

SHELL
flutter --version

개발 환경 진단: flutter doctor

Flutter는 flutter doctor 명령어로 개발에 필요한 모든 도구의 설치 상태를 한눈에 확인할 수 있습니다.

SHELL
flutter doctor
PLAINTEXT
[✓] Flutter (Channel stable, 3.x.x, on macOS darwin-arm64, locale ko-KR)
[✓] Android toolchain - develop for Android devices
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web

상태 표시 해석

기호의미조치
설치 및 설정 완료문제 없음
!경미한 문제개발 가능하나 해결 권장
필수 구성 요소 누락즉시 수정 필요

flutter doctor에서  가 아닌 항목이 있다면, 아래 섹션별 해결 방법을 참고합니다.


Dart 경로 충돌 해결

flutter doctor 실행 시 Dart 경로 경고가 나타날 수 있습니다. 이는 Homebrew로 별도 설치된 Dart SDK가 Flutter에 내장된 Dart와 충돌하기 때문입니다. Flutter SDK에는 Dart가 포함되어 있으므로, 별도로 설치된 Dart를 제거하면 해결됩니다.

SHELL
brew uninstall dart
brew cleanup

Android 개발 환경 설정

Unable to locate Android SDK

Android SDK가 설치되어 있지 않을 때 나타나는 오류입니다.

해결 방법:

1. Android Studio 설치

SHELL
brew install --cask android-studio

2. SDK Tools 설정

  1. Android Studio를 실행합니다.
  2. Preferences(Cmd + ,) > System Settings > Android SDK > SDK Tools 탭으로 이동합니다.
  3. Android SDK Command-line Tools (latest) 를 체크합니다.
  4. Apply 를 클릭하여 설치합니다.

3. 라이선스 동의

SHELL
flutter doctor --android-licenses

모든 라이선스에 y를 입력하여 동의합니다.


iOS 개발 환경 설정

Xcode installation is incomplete

Xcode가 설치되어 있지 않거나 설정이 완료되지 않았을 때 나타나는 오류입니다.

** 해결 방법:**

1. Xcode 설치

App Store에서 Xcode 를 검색하여 설치합니다.

2. 명령줄 도구 설정

SHELL
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch

CocoaPods not installed

CocoaPods 는 iOS 프로젝트의 의존성 관리 도구입니다. Flutter iOS 빌드 시 필수로 요구됩니다.

SHELL
brew install cocoapods

Unable to get list of installed Simulator runtimes

iOS 시뮬레이터 런타임이 설치되어 있지 않을 때 나타나는 오류입니다.

SHELL
xcodebuild -downloadPlatform iOS

**참고 **: iOS 시뮬레이터 다운로드에는 수 GB의 저장 공간과 상당한 시간이 소요될 수 있습니다.


최종 확인

모든 설정을 완료한 후 flutter doctor를 다시 실행하여 모든 항목이 상태인지 확인합니다.

SHELL
flutter doctor
PLAINTEXT
[✓] Flutter (Channel stable, 3.x.x, on macOS darwin-arm64, locale ko-KR)
[✓] Android toolchain - develop for Android devices
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web

모든 항목이 체크되어 있다면 Flutter 개발 환경 구성이 완료된 것입니다.


주의할 점

Dart SDK 별도 설치 시 경로 충돌

Homebrew로 Dart를 별도 설치한 상태에서 Flutter를 설치하면 Dart 경로가 충돌합니다. Flutter SDK에는 Dart가 이미 포함되어 있으므로, 별도 Dart는 brew uninstall dart로 제거합니다.

iOS 시뮬레이터 다운로드 용량

xcodebuild -downloadPlatform iOS 명령은 수 GB의 데이터를 다운로드합니다. 디스크 공간과 시간을 충분히 확보한 뒤 실행합니다.


정리

단계명령
Flutter 설치brew install flutter
환경 진단flutter doctor
Dart 충돌 해결brew uninstall dart
Android SDKAndroid Studio 설치 → SDK Tools 설정 → flutter doctor --android-licenses
iOS 환경Xcode 설치 → xcode-select --switchbrew install cocoapods
최종 확인flutter doctor에서 모든 항목 체크
댓글 로딩 중...