Communitygithub.com

V4TIME/V4SKILL

透過 macOS 上的 FindMy.app 追蹤 Apple 裝置與 AirTag。

V4SKILL 是什麼?

此技能讓 AI 代理能夠透過 UI 自動化操作 macOS 的「Find My」應用程式,來追蹤 Apple 裝置與 AirTag 的位置。因為 Apple 未提供個人化指令介面 (CLI) 或 API,技能採用 AppleScript 與螢幕截圖的方式來讀取裝置位置資訊。您需要授予終端機或整合開發環境「螢幕錄製」權限,且裝置或 AirTag 必須預先註冊在「Find My」中。技能支援多種方法:基礎的 AppleScript + 螢幕截圖法來開啟應用程式並擷取畫面,以及建議使用的「Peekaboo」工具(可透過 Homebrew 安裝)來實現更穩定的使用者介面互動。此技能特別適合回答「我的 [裝置/寵物/鑰匙/背包] 在哪裡?」這類問題,也可用於監控寵物或物品長時間的移動路線(例如貓的巡邏路徑)。因為「Find My」必須保持在前景而 AirTag 才能更新位置,因此技能會採取保持視窗開啟並定期擷取畫面的工作流程,並以 `vision_analyze` 功能來解析螢幕截圖中的座標與地址。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/V4TIME/V4SKILL/tree/HEAD/apple/findmy

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Find My (Apple)

在 macOS 上透過 FindMy.app 追蹤 Apple 裝置與 AirTag。由於 Apple 沒有為 Find My 提供命令列介面,此技能使用 AppleScript 來開啟應用程式,並以螢幕擷取功能讀取裝置位置。

必要條件

  • macOS:需安裝 Find My 應用程式並登入 iCloud
  • 裝置 / AirTag 已預先註冊在 Find My 中
  • 終端機的「螢幕錄製」權限(系統設定 → 隱私權與安全性 → 螢幕錄製)
  • 建議安裝:peekaboo 可獲得更好的 UI 自動化效果: brew install steipete/tap/peekaboo

使用時機

  • 使用者詢問「我的 [裝置/貓/鑰匙/背包] 在哪裡?」
  • 追蹤 AirTag 位置
  • 檢查裝置位置(iPhone、iPad、Mac、AirPods)
  • 長時間監控寵物或物品的移動(AirTag 巡邏路線)

方法一:AppleScript + 螢幕截圖(基本)

開啟 FindMy 並導航

# 開啟 Find My 應用程式
osascript -e 'tell application "FindMy" to activate'

# 等待載入
sleep 3

# 擷取 Find My 視窗畫面
screencapture -w -o /tmp/findmy.png

然後使用 vision_analyze 來讀取螢幕截圖:

vision_analyze(image_url="/tmp/findmy.png", question="畫面中顯示哪些裝置/物品及其位置?")

切換分頁

# 切換到裝置分頁
osascript -e '
tell application "System Events"
    tell process "FindMy"
        click button "Devices" of toolbar 1 of window 1
    end tell
end tell'

# 切換到物品分頁(AirTag)
osascript -e '
tell application "System Events"
    tell process "FindMy"
        click button "Items" of toolbar 1 of window 1
    end tell
end tell'

方法二:Peekaboo UI 自動化(建議)

如果安裝了 peekaboo,可用它進行更可靠的 UI 互動:

# 開啟 Find My
osascript -e 'tell application "FindMy" to activate'
sleep 3

# 擷取並標註 UI
peekaboo see --app "FindMy" --annotate --path /tmp/findmy-ui.png

# 按元素 ID 點選特定裝置/物品
peekaboo click --on B3 --app "FindMy"

# 擷取詳細檢視
peekaboo image --app "FindMy" --path /tmp/findmy-detail.png

然後用視覺分析:

vision_analyze(image_url="/tmp/findmy-detail.png", question="此裝置/物品顯示的位置為何?請包含地址與座標(若可見)")

工作流程:長時間追蹤 AirTag 位置

用於監控 AirTag(例如追蹤貓的巡邏路線):

# 1. 開啟 FindMy 到物品分頁
osascript -e 'tell application "FindMy" to activate'
sleep 3

# 2. 點選該 AirTag 物品(保持頁面開啟 — AirTag 僅在頁面開啟時更新位置)

# 3. 定期擷取位置
while true; do
    screencapture -w -o /tmp/findmy-$(date +%H%M%S).png
    sleep 300  # 每 5 分鐘
 done

用視覺分析每張螢幕截圖以提取座標,然後編譯路線。

限制

  • Find My 沒有命令列或 API — 必須使用 UI 自動化
  • AirTag 僅在 Find My 頁面保持顯示時才會更新位置
  • 位置準確度取決於 Find My 網路中附近 Apple 裝置的數量
  • 需要「螢幕錄製」權限才能進行螢幕擷取
  • AppleScript UI 自動化可能因 macOS 版本更新而失效

規則

  1. 追蹤 AirTag 時讓 FindMy 應用程式保持在前景(最小化時更新會停止)
  2. 使用 vision_analyze 讀取螢幕截圖內容 — 不要嘗試解析像素
  3. 進行長時間追蹤時,使用 cron 定時任務定期擷取並記錄位置
  4. 尊重隱私 — 僅追蹤使用者擁有的裝置/物品

Individual skills in this repo

This repo contains 12 individual skills — each has its own dedicated page.

相關技能