Apple 查找设备
通过 macOS FindMy.app 追踪 Apple 设备和 AirTag 位置
Find My (Apple)
通过 macOS 上的 FindMy.app 追踪 Apple 设备和 AirTag。由于 Apple 没有
为 FindMy 提供 CLI,本技能使用 AppleScript 打开应用,并通过
屏幕截图来读取设备位置。
前置条件
peekaboo 以获得更好的 UI 自动化:brew install steipete/tap/peekaboo
使用场景
方法 1:AppleScript + 截图(基础)
打开「查找」并导航
# Open Find My app
osascript -e 'tell application "FindMy" to activate'
# Wait for it to load
sleep 3
# Take a screenshot of the Find My window
screencapture -w -o /tmp/findmy.png
然后使用 vision_analyze 读取截图:
vision_analyze(image_url="/tmp/findmy.png", question="What devices/items are shown and what are their locations?")
在标签页之间切换
# Switch to Devices tab
osascript -e '
tell application "System Events"
tell process "FindMy"
click button "Devices" of toolbar 1 of window 1
end tell
end tell'
# Switch to Items tab (AirTags)
osascript -e '
tell application "System Events"
tell process "FindMy"
click button "Items" of toolbar 1 of window 1
end tell
end tell'
方法 2:Peekaboo UI 自动化(推荐)
如果已安装 peekaboo,请使用它进行更可靠的 UI 交互:
# Open Find My
osascript -e 'tell application "FindMy" to activate'
sleep 3
# Capture and annotate the UI
peekaboo see --app "FindMy" --annotate --path /tmp/findmy-ui.png
# Click on a specific device/item by element ID
peekaboo click --on B3 --app "FindMy"
# Capture the detail view
peekaboo image --app "FindMy" --path /tmp/findmy-detail.png
然后使用视觉分析:
vision_analyze(image_url="/tmp/findmy-detail.png", question="What is the location shown for this device/item? Include address and coordinates if visible.")
工作流程:随时间追踪 AirTag 位置
用于监测 AirTag(例如追踪猫的巡逻路线):
# 1. Open FindMy to Items tab
osascript -e 'tell application "FindMy" to activate'
sleep 3
# 2. Click on the AirTag item (stay on page — AirTag only updates when page is open)
# 3. Periodically capture location
while true; do
screencapture -w -o /tmp/findmy-$(date +%H%M%S).png
sleep 300 # Every 5 minutes
done
用视觉分析每张截图以提取坐标,然后汇总出路线。
限制说明
规则
vision_analyze 读取截图内容 —— 不要试图解析像素安装指南
复制下方命令,在终端运行即可安装:
# 安装到当前项目
npx skills add findmy
# 全局安装 — 所有项目可用
npx skills add findmy -g
需已安装 GenHub 桌面端
使用指南
安装完成后,在对话框中直接使用此技能。