프로그래밍/플러터

플러터 macOS 환경설정

스루나루 2024. 1. 27. 22:14
728x90
728x90

 

플러터 설치

 

1. 아래 사이트에 들어가서 명령어 확인 

https://docs.flutter.dev/get-started/install/macos/mobile-android

 

Start building Flutter Android apps on macOS

Configure your system to develop Flutter mobile apps on macOS and Android.

docs.flutter.dev

 

 

2. 소프트웨어 업데이트 진행

sudo softwareupdate --install-rosetta --agree-to-license

 

 

 

3. homebrew 설치 

 

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

 

https://brew.sh/

 

Homebrew

The Missing Package Manager for macOS (or Linux).

brew.sh

 

4. shell 타입 확인 커맨드 실행

echo $SHELL

 

 

5. /bin/zsh의 경우 환경 변수 등록 명령어

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zshrc
eval "$(/opt/homebrew/bin/brew shellenv)"

 

 

Flutter SDK설치

 

 

1. Brew로 Flutter SDK설치 

brew install --cask flutter

 

 

 

2. 플러터 설치 현황 확인 

flutter doctor -v

 

 

몇 개 설치  덜 됨 마저 설치를 해야한다.

 

Xcode설치

 

1. 앱스토어에서 Xcode 검색 후 다운로드 

 

2. xcode 설치 커맨드 입력

sudo xcode-select --install
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch

 

- 시간이 좀 오래걸림 

 

3. xcode 열어서 확인 

 

4. Devices and Simulators열기 

5. 시뮬레이터 추가 

 

6. ios 다운로드 하기

- OS Version에 가서 ios 옆에 get 버튼 클릭 후 다운로드 하기 

- 너무 큰데? 

 

7. 확인 

- 좌측 편에 ios 기기들 나오면 설치 완료임 

 

 

Android Studio설치 

 

1. 홈페이지 이동 후 다운로드 

 

https://developer.android.com/studio?hl=ko

 

Android 스튜디오 및 앱 도구 다운로드 - Android 개발자  |  Android Developers

Android 스튜디오는 Android 앱에 최적화된 통합 개발 환경(IDE)을 앱 빌더에게 제공합니다. 지금 Android 스튜디오를 다운로드하세요.

developer.android.com

 

- 약관 나오면 동의하고 애플 종류에 맞는 설치파일 다운로드 

 

2. 앱 실행 후 약관 동의 , 필수 파일 등등 설치하기 

 

3. 설치 확인

 

4. 플러그인 설치 

- dart , flutter 플러그인 설치

 

5. 플러그인 설치 확인 

- 홈 화면에 플러터 프로젝트 확인 

- SDK 매니저 가기

 

6. 필요한 SDK설치

 

 

- 아래 그림의 SDK Tools를 설치

 

 

7. 환경변수 설정 

 

- 안드로이드 sdk 경로 복사

 

 

- nano ~/.zshrc 입력 후 아래처럼 환경변수 설정 

 

 

8. flutter doctor로 확인

 

Android toolchain 해결

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

 

1. 안드로이드 라이선스 명령어 입력 

flutter doctor --android-licenses

 

2. yes를 계속 입력하면 오케이 

 

 

cocoapods 해결

 

[!] Xcode - develop for iOS and macOS (Xcode 15.2)
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

 

 

1. cocoapods 설치

brew install cocoapods

 

대기 후 그대로 기다려주면 됨! 

 

 

마지막 에러 확인

 

 

 

 

결론

 

이건 뭔데 이렇게 설치하는게 복잡한지 일단 이걸로 플러터 설치가 끝났다.

 

 

참고

https://youtu.be/DDCqlDrWsXU?si=gvICiZtGC6vzkaAI

 

728x90
728x90