1、下载鸿蒙开发工具
deveco-studio-5.0.3.600
下载地址:https://developer.huawei.com/consumer/cn/download/
2、安装Java17
oracle官方Java17
https://www.oracle.com/java/technologies/downloads/#java17
3、下载Flutter(目前Harmony只支持Flutter3.7.12版本)
git clone https://gitee.com/openharmony-sig/flutter_flutter.git
4、配置环境
export PATH=/Users/admin/flutter_flutter/bin:$PATH
# 国内镜像
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
# 拉取下来的flutter_flutter/bin目录
export PATH=/Users/admin/flutter_flutter/bin:$PATH
# HamonyOS SDK
export TOOL_HOME=/Applications/DevEco-Studio.app/Contents # mac环境
export DEVECO_SDK_HOME=$TOOL_HOME/sdk # command-line-tools/sdk
export PATH=$TOOL_HOME/tools/ohpm/bin:$PATH # command-line-tools/ohpm/bin
export PATH=$TOOL_HOME/tools/hvigor/bin:$PATH # command-line-tools/hvigor/bin
export PATH=$TOOL_HOME/tools/node/bin:$PATH # command-line-tools/tool/node/bin
5、检查
flutter doctor -v