鸿蒙Flutter三方库适配指南-04.使用MacOS搭建开发环境

准备工作

1.安装 DevEco Studio NEXT IDE,

2.安装 Git

Mac 安装

下载 Flutter SDK

bash 复制代码
# 创建目录
mkdir -p ~/fvm/versions
# 克隆仓库
git clone -b br_3.22.0-ohos-1.0.4 git@gitcode.com:openharmony-tpc/flutter_flutter.git custom_3.22.0

环境变量配置

打开 ~/.bash_profile 文件或者 ~/.zshrc 文件编辑,添加以下内容

bash 复制代码
# Flutter SDK
export PATH=~/fvm/versions/custom_3.22.0/bin:$PATH

# Flutter Mirror
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

# HarmonyOS SDK
export TOOL_HOME=/Applications/DevEco-Studio.app/Contents/
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

检查安装状态

运行 flutter doctor 检查状态

bash 复制代码
flutter doctor
  1. 检查 Flutter Channel 是否包含 ohos-3.22.0
  2. 检查 HarmonyOS toolchain 是否通过
相关推荐
爱写Bug的浮游5 小时前
初识仓颉:5 分钟看懂核心语法
harmonyos·编程语言
oil欧哟8 小时前
Oil Studio 的产品思路与日常使用方式:在 Mac 上录口播演示,并接入 AI Agent 精剪与自动录屏
人工智能·macos
恋猫de小郭8 小时前
Jetpack Compose 1.13 发布,憋了这么久终有交代了
android·前端·flutter
程序猿追18 小时前
鸿蒙 PC 的 Ionic 工单有两个错误,按下生成后光标该去哪儿
华为·harmonyos
好的佩奇20 小时前
蓝牙之设备角色与连接
android·flutter·蓝牙
KevinChaos1 天前
随手备忘录手记 04|HarmonyOS 7.0新特性实验:物品图鉴的加载逻辑
华为·harmonyos
Sirius_Ji1 天前
从硬解基座到字幕与滤镜链:ffmpeg-for-HarmonyOS v0.3.2
harmonyos
用户86194177207411 天前
uni-app 鸿蒙端提现点不动?我用 UTS 插件补上了微信"确认收款"
微信·harmonyos
码间留白1 天前
uni-app 鸿蒙端提现点不动?我用 UTS 插件补上了微信"确认收款"
uni-app·harmonyos·鸿蒙·uts插件·微信商家转账
SoaringHeart2 天前
Flutter最佳实践:用 flutter_html 渲染富文本
前端·flutter