Mac configuration flutter

1, go to the official website to download the recommended speed is not slow at:

https://flutter.io/setup-macos/

Configuration environment variable, here I use the command line:

vim ~/.bash_profile

Adding environment configuration

export PATH=/你的flutter文件夹所在位置/flutter/bin:$PATH

Save it, note that if this file does not exist, then create a new one. After running the command has been saved:

source ~/.bash_profile

This time should be able to run the command flutter, we run the command line:

flutter -h

Looks so simple: pit but still a lot of
pit 1, .bash_profile file does not exist create a

touch .bash_profile

Add the following configuration

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=/Users/ruihe/Downloads/flutter/bin:$PATH

Pit 2,
MacBook-Pro: xxxx ~ $ Flutter -h
-bash: Flutter: the Command not found
then downloaded to copy files to other went inside run source ~/.bash_profilehas been holding this wrong, tangled for a long time, and finally re-download a directly the download path / Users / xxxx / Downloads / set inside,
xxxxxx $ Open ~ / .bash_profile
xxxxxx $ Source .bash_profile
xxxxxx $ Source ~ / .bash_profile
mainly 2 and 3 do not know that is right, it is a bit run together
pit 3,

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale
    zh-Hans-CN)
[✗] 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/setup/#android-setup for detailed
      instructions).
      If the Android SDK has been installed to a custom location, set
      ANDROID_HOME to that location.
      You may also want to add it to your PATH environment variable.

[!] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS
      development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
[!] iOS tools - develop for iOS devices
    ✗ Verify that all connected devices have been paired with this computer in
      Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may
      require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
[!] Android Studio (not installed)
[!] Connected device
    ! No devices available

! Doctor found issues in 5 categories.

Follow the prompts:

Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

To update with Brew, run:
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller

1. Download AndroidStudio and SDK 
Download: http://www.android-studio.org 
1⃣️ download AndroidStudio  
choose Mac version download

Android Studio installation details
after the completion of

Run flutter doctor again

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale
    zh-Hans-CN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[✓] iOS tools - develop for iOS devices
[!] Android Studio (version 3.4)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (1 available)

Installation flutter, dart restart Android Studio
image.png

Run again

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale
    zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.4)
[✓] Connected device (1 available)

. 1, Flutter development (1) iOS integrated ultra detail Flutter
2, Flutter environment configuration Detailed MAC version
3, mounted on Macbook pro Android studio

Guess you like

Origin www.cnblogs.com/xiaowuqing/p/11388606.html