Flutter development environment configuration (MAC version)

First, the configuration mirroring

  1. Open the terminal command, enter commands open ~/.bash_profile, text bash_profile open, save and add a mirror path
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://flutter-io.cn

(The path will vary, you can focus Flutter community, updated)

  1. A terminal command, a command input source ~/.bash_profile, perform mirroring configuration takes effect

Second, the configuration flutterSDK

  1. flutter official website to download flutter SDK, placed in a directory (My Documents directory on the next)
  2. Sdk path will be entered into bash_profile, enter the command open ~/.bash_profile, open bash_profile text, add and save the file path sdk
export PATH=~/Documents/fluttersdk/bin:$PATH

Documents directory, fluttersdk for the sdk folder

Third, execute the command terminal project

cdCorresponding to the project in the command:

flutter emulators // 查看当前模拟器
flutter emulator --launch apple_ios_simulator -  // 启动模拟器
flutter run // 执行项目工程,若有多个设备连接,需要 -d <设备的id>执行某个模拟器 

Fourth, view the Android and iOS dependence is missing

In the terminal execution flutter doctorview Android and iOS development environment, if dependent on the monitored item is missing, the result will give missing dependencies, in accordance with the instruction to install.

Five, iOS chain configuration tool - can run on the real machine apparatus iOS

Implementation of the relevant commands in the command terminal:

brew update
brew install --HEAD usbmuxd  // usbmuxd是一个与iOS设备建立多路通信连接的socket守护进程,通过它,可以将USB通信抽象为TCP通信 brew link usbmuxd brew install --HEAD libimobiledevice // libimobiledevice是一个与iOS设备进行通信的跨平台协议库 brew install ideviceinstaller // ideviceinstaller 是一个使用他们在iOS设备上管理APP的工具 

Six, Android tool chain configuration

Open the Android Studio application, open the menu item Preferences> Plugins in search Flutter plug-in and click install to install

Seven, VS Code Configuration

Open VS Code, click on View -> Command Palette, search flutter and click install to install

Guess you like

Origin www.cnblogs.com/shsuper/p/11536467.html