|
|
hai 3 semanas | |
|---|---|---|
| .. | ||
| .github | hai 3 semanas | |
| build | hai 3 semanas | |
| docs | hai 3 semanas | |
| electron | hai 3 semanas | |
| renderer | hai 3 semanas | |
| resources | hai 3 semanas | |
| scripts | hai 3 semanas | |
| tests | hai 3 semanas | |
| LICENSE | hai 3 semanas | |
| README.md | hai 3 semanas | |
| THIRD_PARTY_NOTICES.md | hai 3 semanas | |
| package-lock.json | hai 3 semanas | |
| package.json | hai 3 semanas | |
| start-mac.command | hai 3 semanas | |
一个面向 macOS 的 LuatOS 固件烧录工具。界面是 Electron,烧录内核是纯 Rust 的
luatos-cli(MIT),所以不需要 Wine,也不需要
Windows 虚拟机。
当前工程已在 Windows 上用
luatos-cli1.11.0 做过 CLI/解析/错误路径验证; macOS 的.app/.dmg需要在 Mac 上执行一次npm run dist:mac生成。 未签名的本地构建可以直接运行;对外分发建议做 Developer ID 签名 + 公证。
| 型号 | 芯片 | 烧录 |
|---|---|---|
| Air8101 | BK7258 / bk72xx | ✅ |
| Air1601 / Air1602 / Air1603 / Air1604 | CCM4211 | ✅ |
| Air8000 / Air780E 系列 | EC718 / EC7xx | ✅ |
| Air6208 / Air101 / Air103 / Air601 | XT804 | ✅ |
| Air724UG / Air795UG | UIS8910DM / RDA8910 | ✅(以实际固件为准) |
| SF32LB58 | SF32 | ✅ |
| Air105 / ASR1802 / ASR1601 / UIS8850 | — | ❌ 当前内核未覆盖 |
具体以 luatos-cli guide models 的输出为准;App 内“支持的型号”也会实时读取。
固件可以从 LuatOS 文档中心 对应模组页面下载 .soc 文件。
要求:macOS 12+,Node.js 20+(Apple Silicon / Intel 均可)。
cd luatools-mac
npm install
npm start
macOS 上也可以双击 start-mac.command(首次需要执行
chmod +x start-mac.command;如果双击没反应,执行 bash start-mac.command),
它会自动安装依赖并启动 App。
首次启动会自动读取 resources/bin/luatos-cli(macOS)或
resources/win/luatos-cli.exe(Windows)。如果缺少,执行:
npm run fetch:cli
也可以设置环境变量指向已有二进制:
LUATOS_CLI=/path/to/luatos-cli npm start
luatos-cli 1.11.0 能正常启动、枚举串口、解析 .socCOM99)能正确显示进度、错误信息和日志resources/bin/luatos-cli.exe 调用内核npm run dist:win)macOS 的
.app/.dmg无法在 Windows 上签名和公证,因此需要在 Mac 或 GitHub Actions 的 macOS runner 上构建;构建脚本已经准备好。
在 Mac 上:
cd luatools-mac
chmod +x scripts/build-mac.sh
./scripts/build-mac.sh
或者手动:
npm ci
npm run fetch:cli
npm run dist:mac
产物在 dist/:
LuatOS Flasher-0.1.0-universal.dmgLuatOS Flasher-0.1.0-universal-mac.zipdist:mac 默认 不签名(CSC_IDENTITY_AUTO_DISCOVERY=false)。
如果 macOS 提示“无法验证开发者”:
xattr -cr "/Applications/LuatOS Flasher.app"
# 或者右键 App -> 打开
本地临时签名也可以:
chmod +x scripts/fix-macos-gatekeeper.sh
./scripts/fix-macos-gatekeeper.sh "dist/mac-universal/LuatOS Flasher.app"
该脚本会清理 quarantine 并做 ad-hoc 签名,适合本地自用;对外分发仍应使用 Developer ID。
npm run dist:win
产物:dist/LuatOS Flasher Setup 0.1.0.exe。
Windows 包会把 resources/win/luatos-cli.exe 放到安装目录的 resources/bin/。
准备 Apple Developer ID Application 证书,然后:
export CSC_LINK="/path/to/developer-id.p12"
export CSC_KEY_PASSWORD="p12-password"
npm run dist:mac:signed
xcrun notarytool submit "dist/LuatOS Flasher-0.1.0-universal.dmg" \
--apple-id "you@example.com" \
--team-id "TEAMID" \
--password "app-specific-password" \
--wait
xcrun stapler staple "dist/LuatOS Flasher-0.1.0-universal.dmg"
App 内置的 luatos-cli 会在 afterPack 阶段被 codesign 签掉;
如果使用正式证书,请设置 CSC_NAME 让 sidecar 使用同一身份。
npm run test:smoke # 解析内置测试固件,检查芯片/版本/文件列表
npm run test:flash-error # 用不存在的 COM99 跑完整烧录链路,检查错误处理
自检用的是
tests/fixtures/air8101-dummy.soc假固件,只包含 1 KB 占位数据, 不要把它烧录到真实设备。
/dev/cu.usbmodem*)。.soc 固件。Luatools v3 是 Windows 专用的 PyInstaller onefile + wxPython 程序,烧录链路里混有
FlashToolCLI.exe、CmdDloader.exe、aboot.dll 等 Windows 二进制。直接把它重打包到
macOS 不可行。这个项目把“界面”和“烧录”拆开:
Electron UI ──IPC──> Node 主进程 ──spawn──> luatos-cli (Rust)
│
└── USB 串口 ──> 设备
因此 macOS 上不需要任何 Windows 组件。需要新增芯片时,优先在 luatos-cli 里实现协议,
App 只负责选择端口、解析固件、显示进度和日志。
luatools-mac/
electron/
main.js # Electron 主进程 / IPC / 烧录进程管理
preload.js # 安全桥
cli.js # luatos-cli 定位、JSON/JSONL 解析、取消
renderer/
index.html # 单页界面
styles.css # 深色主题
app.js # 交互逻辑
resources/bin/
luatos-cli # macOS universal(已内置 1.11.0)
resources/win/
luatos-cli.exe # Windows x64(开发测试用,不打进 macOS 包)
scripts/
fetch-cli.mjs # 下载对应平台 luatos-cli
after-pack.cjs # 打包后 chmod + codesign sidecar
build-mac.sh # macOS 一键构建
build/
entitlements.mac.plist
.github/workflows/build-macos.yml
ls /dev/cu.*。luatos-cli 找不到npm run fetch:cli
# 或
export LUATOS_CLI=/absolute/path/to/luatos-cli
npm start
npm install 很慢或失败国内网络可以换镜像:
npm config set registry https://registry.npmmirror.com
npm install
本地构建用:
CSC_IDENTITY_AUTO_DISCOVERY=false npm run dist:mac
正式签名再设置 CSC_LINK / CSC_KEY_PASSWORD。
luatos-cli 是 MIT 许可的独立项目;本工程只通过子进程调用它,不复制其源码。luatos-cli 版本,并对下载的二进制做 SHA-256 校验。luatos-cli log view / view-binary)