# 克隆仓库
git clone https://github.com/tuya/TuyaOpen.git
# 或使用国内镜像
git clone https://gitee.com/tuya-open/TuyaOpen.git
cd TuyaOpen
# 激活工具环境
. ./export.sh # Linux/Mac
.\export.bat # Windows
# 验证安装
tos.py version
tos.py check
# 进入示例项目目录
cd apps/tuya_cloud/switch_demo
# 选择硬件配置
tos.py config choice
# 根据提示选择对应的开发板配置(如T5AI.config)
# 编译项目
tos.py build
# 清理编译缓存
tos.py clean # 基础清理
tos.py clean -f # 深度清理
# 烧录固件
tos.py flash
# 根据提示选择串口
# 查看设备日志
tos.py monitor
# 根据提示选择串口
# 设备授权
tos.py monitor -b 115200
auth uuid密钥 authkey密钥
# 退出日志查看
Ctrl+c 然后按回车
sudo usermod -aG dialout $USER
并重启系统git submodule update --init
tuya_config.h
文件中的授权信息tos.py --help
查看详细命令说明