2022. 6. 12. 22:59ㆍDEV/Flutter
System Requirements
- Operating Systems: macOS
- Disk Space: 2.8 GB (does not include disk space for IDE/tools).
- Tools: Flutter uses git for installation and upgrade. We recommend installing Xcode, which includes git, but you can also install git separately.
X-code 설치
X-code 확인
- X-Code 실행하기
- License 확인
sudo xcodebuild -license # space bar를 눌러 끝까지 내려간다
By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel] agree ## agree 입력 You can view the license agreements in Xcode's About Box, or at /Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf
⚠️ 주의사항 ⚠️
Apple Silicon Mac의 경우 "Rosetta translation environment"가 가능해야 한다하니 Flutter Install의 내용을 확인할 것.
※ X-code 설치가 안될 때 참고
Mac Full Xcode 설치하기
Flutter 설치
다운로드 및 설치
zip 파일을 다운로드 받은 후 원하는 경로에 압축을 푼다.
cd ~ #압축을 풀 경로로 이동
unzip ~/Downloads/flutter_macos_3.0.1-stable.zip # 압축 해제
경로 설정
# 경로 설정 추가 -> 저장
$ vim ~/.bash_profile
export PATH="$PATH:[PATH_OF_FLUTTER_GIT_DIRECTORY]/bin"
# 변경 사항 적용
$ source .bash_profile
# PATH 확인
$ echo $PATH
/Users/MiKy/anaconda3/bin:/Users/MiKy/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/MiKy/devtools/flutter/bin
# flutter 경로 확인
$ which flutter
/Users/MiKy/devtools/flutter/bin/flutter
설치 확인
$ flutter doctor
╔════════════════════════════════════════════════════════════════════════════╗
║ Welcome to Flutter! - https://flutter.dev ║
║ ║
║ The Flutter tool uses Google Analytics to anonymously report feature usage ║
║ statistics and basic crash reports. This data is used to help improve ║
║ Flutter tools over time. ║
║ ║
║ Flutter tool analytics are not sent on the very first run. To disable ║
║ reporting, type 'flutter config --no-analytics'. To display the current ║
║ setting, type 'flutter config'. If you opt out of analytics, an opt-out ║
║ event will be sent, and then no further information will be sent by the ║
║ Flutter tool. ║
║ ║
║ By downloading the Flutter SDK, you agree to the Google Terms of Service. ║
║ Note: The Google Privacy Policy describes how data is handled in this ║
║ service. ║
║ ║
║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and ║
║ crash reports to Google. ║
║ ║
║ Read about data we send with crash reports: ║
║ https://flutter.dev/docs/reference/crash-reporting ║
║ ║
║ See Google's privacy policy: ║
║ https://policies.google.com/privacy ║
╚════════════════════════════════════════════════════════════════════════════╝
Running "flutter pub get" in flutter_tools... 13.5s
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.1, on macOS 11.6.6 20G624 darwin-x64, locale en-KR)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for
detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
✗ 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.
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] VS Code (version 1.67.0)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
! Doctor found issues in 3 categories.
Android Studio 설치
Andriod Studio
Android Studio 사이트에서 Download Android Studio를 눌러 설치 파일(※ 앞서 시스템 설정에서 언급했던 Apple Silicon Mac의 기준 확인)을 다운로드한다.
다운로드한 파일을 실행하여 앱 아이콘을 폴더로 드래그&드롭한 뒤 Anddroid Studio를 실행하여 기본 설정대로 설치를 진행한다.
SDK
이제 추가로 SDK 설치를 진행한다.
More Option > SDK Manager
Android SDK > SDK Tools에서 Android SDK Command-line Tools를 추가로 선택해서 설치한다.
기본 설정대로 쿨하게 설치 완료!
X-code cocoapod 설치
다시 한 번 flutter doctor로 확인한다.
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.1, on macOS 11.6.6 20G624 darwin-x64, locale en-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
✗ 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.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.67.0)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
아직 하나 더 남았다.
cocoapod
CocoaPods 사이트에서 설치 명령어를 확인하여 설치를 진행한다.
$ sudo gem install cocoapods
온갖 오류가 뜬다. 하라는 명령어를 실행해도 안되고, 뭘 해도 안된다.
결국 찾다보니 나와 같은 상황의 어떤 사람이 우리 MAC의 희망, HOMEBREW로 설치를 했다는 걸 발견했다.
brew install cocoapods
깔끔하게 완료된다. 역시 Homebrew는 사랑이다!!
이제 마지막으로 확인을 해본다.
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.1, on macOS 11.6.6 20G624 darwin-x64, locale
en-KR)
Checking Android licenses is taking an unexpectedly long time...[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.67.0)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
• No issues found!
설치 완료!!!
💡 Editor IDE
Andriod Studio, Visual Studio Code 등 여러 Editor를 선택하여 사용할 수 있다.
※ 참고 : https://flutter.io/get-started/editor/
프로젝트 만들고 시작하기
- Mac - Visual Studio Code에서 Flutter 설정 및 프로젝트 시작하기
- Flutter Project 생성하기
- VSCODE - Flutter Extension 및 추가 설정
REFERENCE
- Flutter 설치법 : Flutter Doc
- Homebrew 사용 설치 방법(참고용) : [플러터] mac에서 homebrew로 flutter 설치 (5초면 끝남)
'DEV > Flutter' 카테고리의 다른 글
Flutter 프로젝트에 Firebase 연동하기 (0) | 2022.07.13 |
---|---|
Flutter - Form Validation (0) | 2022.07.13 |
What's new in Flutter 2022 (0) | 2022.07.06 |
VSCODE - Flutter Extension 및 추가 설정 (0) | 2022.06.29 |
Mac - Visual Studio Code에서 Flutter 설정 및 프로젝트 시작하기 (0) | 2022.06.25 |
Flutter Project 생성하기 (0) | 2022.06.25 |
Android Studio 코드 자동 포맷 설정하기 (0) | 2022.06.13 |
Mac Android Studio에서 Emulator 생성 및 실행하기 (0) | 2022.06.12 |