언어

[맥북프로 M1] mac install flutter 플루터 설치하기

함부작 2020. 12. 23. 23:36

새로 구매한 나의 m1 macbook pro 에 flutter를 설치해보겠다 ! 

 

 

1. flutter 사이트에서 mac flutter 다운로드

 

flutter.dev/docs/get-started/install/macos

 

macOS install

How to install on macOS.

flutter.dev

 

2. 터미널에서 development폴더 생성

 

mkdir ~/development

 

3. 다운로드 받은 flutter폴더를 ~/development 하위로 이동

 

 

4. development 폴더로 이동

 

cd ~/development

5. flutter tool 추가

 

export PATH="$PATH:`pwd`/flutter/bin"

6. flutter doctor로 부족한 것 check

 

flutter doctor

 

[ 결과 ]

해야할 것들을 알 수 있음

android studio 설치, 

xcode에서 CocoaPods 설치

connect device -> 이건 나중에 연결해도 무방..

 

 

 

Last login: Wed Dec 23 22:09:34 on ttys001
abc@abcui-MacBookPro ~ % cd ~/development
abc@abcui-MacBookPro development % export PATH="$PATH:`pwd`/flutter/bin"
abc@abcui-MacBookPro development % flutter doctor
objc[11774]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1fdba27a0) and ?? (0x114a042b8). One of the two will be used. Which one is undefined.
objc[11774]: Class AMSupportURLSession is implemented in both ?? (0x1fdba27f0) and ?? (0x114a04308). One of the two will be used. Which one is undefined.
Downloading Dart SDK from Flutter engine ae90085a8437c0ae94d6b5ad2741739ebc742cb4...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  172M  100  172M    0     0  8607k      0  0:00:20  0:00:20 --:--:-- 8965k
Building flutter tool...

  ╔════════════════════════════════════════════════════════════════════════════╗
  ║                 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                                        ║
  ╚════════════════════════════════════════════════════════════════════════════╝


Downloading Material fonts...                                       0.5s
Downloading Gradle Wrapper...                                       0.0s
Downloading package sky_engine...                                   0.1s
Downloading flutter_patched_sdk tools...                            1.4s
Downloading flutter_patched_sdk_product tools...                    1.4s
Downloading darwin-x64 tools...                                     4.0s
Downloading libimobiledevice...                                     0.0s
Downloading usbmuxd...                                              0.0s
Downloading libplist...                                             0.0s
Downloading openssl...                                              0.2s
Downloading ios-deploy...                                           0.0s
Downloading darwin-x64/font-subset tools...                         0.3s
Downloading android-arm-profile/darwin-x64 tools...                 0.5s
Downloading android-arm-release/darwin-x64 tools...                 0.4s
Downloading android-arm64-profile/darwin-x64 tools...               0.6s
Downloading android-arm64-release/darwin-x64 tools...               0.4s
Downloading android-x64-profile/darwin-x64 tools...                 0.4s
Downloading android-x64-release/darwin-x64 tools...                 0.3s
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on macOS 11.0.1 20B29 darwin-arm, locale ko-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, set ANDROID_SDK_ROOT to that
      location.
      You may also want to add it to your PATH environment variable.

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    ✗ 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:
        sudo gem install cocoapods
[!] Android Studio (not installed)
 
[!] Connected device                          
    ! No devices available

! Doctor found issues in 4 categories.
abc@abcui-MacBookPro development %  

 

7. android studio 설치

 

developer.android.com/studio

 

Download Android Studio and SDK tools  |  Android 스튜디오

developer.android.com

다만, 아직 m1에서는 하드웨어 에뮬레이터를 지원하지 않음.

 

8. cocoapods 설치

 

 

sudo gem install cocoapods

 

9. 다시 flutter doctor로 체크

시키는대로 android licenses동의 필요하고,

android studio 추가 plugin으로 flutter, dart 추가 필요 ! ! 

하드웨어는 나중에 연결

 

 

[✓] Flutter (Channel stable, 1.22.5, on macOS 11.0.1 20B29 darwin-arm, locale ko-KR)
 
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ✗ Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[!] Android Studio (version 4.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
    ! No devices available

10. Android licenses not accepted 해결

시키는 코드 그대로 입력해준다

입력하면 동의할지 y/N 누르라고 나오는데 계속 y+엔터 눌러주면 끝 

 

 

flutter doctor --android-licenses

11. 다시 flutter doctor로 체크

 

이제 플러그인만 설치해주면 되겠다ㅎㅎ

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on macOS 11.0.1 20B29 darwin-arm, locale ko-KR)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[!] Android Studio (version 4.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
    ! No devices available

12. adroid studio plugin 설치

 

Android studio 실행 > Configure > Plugin선택 

 

dart 검색 후 설치 

flutter 검색 후 설치 

android studio 재 실행

 

13. 또 다시 flutter doctor 실행

Flutter , Dart plugin이 설치되었는데도 설치되지 않았다고 나온다.

찾아보니 android studio ver 4.1문제고 flutter이용하는데 아무 문제도 없다고 한다.

 

14. 디바이스 연결

개발자 옵션 > usb 디버깅 허용 

설정한 후 usb로 컴퓨터와 연결해준당 

 

15. 최종 flutter doctor 

 

Doctor summary (to see all details, run flutter doctor -v):

[✓] Flutter (Channel stable, 1.22.5, on macOS 11.0.1 20B29 darwin-arm, locale ko-KR)

 

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)

[!] Android Studio (version 4.1)

    ✗ Flutter plugin not installed; this adds Flutter specific functionality.

    ✗ Dart plugin not installed; this adds Dart specific functionality.

[✓] Connected device (1 available)

 

 

16. 테스트

 

flutter project 생성

flutter application 선택 

sdk path는 flutter폴더의 bin 설정하면된당..

이렇게 친절하게 초기 화면이 나오고.....초록색 실행 버튼을 누르면 막 일을 시작한다! 

처음에 install해야할 것이 굉장히 많은 듯

 

실행이 완료되면 아래와 같은 앱이 usb로 연결한 휴대폰에 뜨고, +버튼을 누르면 아래 0의 숫자가 점 점 올라간다

flutter 가이드에서는 pushed 라는 문구를 clicked 로 바꿔서 번개 아이콘을 눌러보라고 한다.

그러면 바로, clicked로 변경된 app모습을 폰에서 확인할 수 있다. 

 

 

이상. 설치를 마치고 앞으로 공부를 해야지!! 오예