Files
fenix8v3-watchface/tools/install.sh
ericwyuan 00bce1b6ab 新增 tools/install.sh:一条命令编译并侧载到手表
编译 release 版(enduro3 上 49.6 KB,debug 版是 168 KB),自动找已挂载的
GARMIN 卷复制到 GARMIN/APPS/。找不到卷时打印 .prg 路径和排查提示 —— macOS
上 fenix 7 之后的机型多数走 MTP,Finder 根本看不到这个盘,得用 OpenMTP 之类
的工具,这一点脚本里和 README 里都写了。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 21:16:01 +08:00

62 lines
2.1 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 编译并侧载到通过 USB 接入的 Garmin 手表。
#
# tools/install.sh # 默认 enduro3
# tools/install.sh fenix847mm # 指定机型
#
# 机型 id 见 manifest.xml 的 <iq:product>。
#
# 前提:手表用数据线接到电脑,并且在 Finder 里能看到名为 GARMIN 的卷。
# 看不到的话见本文件末尾的说明。
set -e
DEV="${1:-enduro3}"
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SDK="$HOME/Library/Application Support/Garmin/ConnectIQ/Sdks"
MONKEYC="$(ls -d "$SDK"/*/bin/monkeyc 2>/dev/null | sort | tail -1)"
[ -z "$MONKEYC" ] && { echo "找不到 monkeyc请先装 Connect IQ SDK"; exit 1; }
[ -f "$ROOT/developer_key.der" ] || { echo "缺 developer_key.der"; exit 1; }
grep -q "\"$DEV\"\|id=\"$DEV\"" "$ROOT/manifest.xml" || {
echo "manifest.xml 里没有机型 '$DEV'"; exit 1; }
PRG="$ROOT/bin/Fenix8V3_${DEV}.prg"
echo "==> 编译 $DEVrelease"
mkdir -p "$ROOT/bin"
"$MONKEYC" -o "$PRG" -f "$ROOT/monkey.jungle" -y "$ROOT/developer_key.der" \
-d "$DEV" -r 2>&1 | tail -1
# Garmin 卷的名字通常就是 GARMIN个别机型会带型号后缀
VOL=""
for v in /Volumes/*; do
[ -d "$v/GARMIN" ] && VOL="$v" && break
done
if [ -z "$VOL" ]; then
cat <<'EOS'
==> 没找到手表。
在 Finder 里看不到 GARMIN 卷,通常是这两种情况之一:
1. 表没解锁 —— 部分机型插上后要在表上确认一次
2. 走的是 MTP 协议 —— macOS 的 Finder 不支持 MTP。fenix 7 之后的机型
多半是这种。装一个 OpenMTP免费https://openmtp.ganeshrvel.com
或 Android File Transfer就能像普通盘一样浏览手表了。
用 MTP 工具时,把下面这个文件拖到手表的 GARMIN/APPS/ 目录即可:
EOS
echo " $PRG"
exit 0
fi
DEST="$VOL/GARMIN/APPS"
mkdir -p "$DEST"
cp "$PRG" "$DEST/"
echo "==> 已复制到 $DEST/$(basename "$PRG")"
echo
echo "接下来:"
echo " 1. 在 Finder 里推出Eject手表这个卷再拔线"
echo " 2. 表上长按 UP/MENU -> 表盘 -> 找到 Fenix 8 V3"
echo " 3. 再长按 MENU 可以进这个表盘自己的设置,改主题和四个数据位"