安装Flutter环境

mac 环境安装

系统需求

操作系统: macOS (64-bit)
硬盘: 700 MB
工具: bash, mkdir, rm, git, curl, unzip, which

环境安装

SDK

开发flutter应用程序,需要安装及下载对应的SDK

  1. 下载SDK,并进行解压
  2. 修改配置文件,添加flutter到path路径
    vim ~/.bash_profile
    export PATH=$PATH:`pwd`/flutter/bin
    source ~/.bash_profile

Xcode

iOS开发flutter app,需要安装版本高于9.0的XCode

  1. 通过Mac App Store 安装Xcode
  2. 执行以下命令使用最新的Xcode版本
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

simulator

在开发阶段,可以使用模拟器来进行应用程序的实现及体验

  1. 执行以下命令启动模拟器
open -a Simulator
  1. 在Hardware > Device菜单中设置模拟器的设备运行在64位的环境中

deploy

开发完成应用以后,需要利用部署工具将其部署到物理机器上,利用homebrew来安装对应的工具

  1. 安装 homebrew
  2. 更新最新版本
 brew update
  1. 安装对应工具
 brew install --HEAD usbmuxd
 brew link usbmuxd
 brew install --HEAD libimobiledevice
 brew install ideviceinstaller ios-deploy cocoapods
 pod setup

vscode

我们采用vscode 作为IDE来开发flutter应用程序

  1. 下载并安装vscode
  2. 在扩展安装flutter插件
posted @ 2018-12-28 16:53  S&L·chuck  阅读(309)  评论(0编辑  收藏  举报