欢迎回来

登录 EAKE AI,继续您的智能之旅

忘记密码?
还没有账号?立即注册

Apple 查找设备

Apple 查找设备

通过 macOS FindMy.app 追踪 Apple 设备和 AirTag 位置

Find My (Apple)

通过 macOS 上的 FindMy.app 追踪 Apple 设备和 AirTag。由于 Apple 没有

为 FindMy 提供 CLI,本技能使用 AppleScript 打开应用,并通过

屏幕截图来读取设备位置。

前置条件

  • macOS 搭配「查找」应用并登录 iCloud
  • 设备/AirTag 已注册到「查找」
  • 为终端授予屏幕录制权限(系统设置 → 隐私 → 屏幕录制)
  • 可选但推荐:安装 peekaboo 以获得更好的 UI 自动化:
  • brew install steipete/tap/peekaboo

    使用场景

  • 用户询问「我的[设备/猫/钥匙/包]在哪里?」
  • 追踪 AirTag 位置
  • 查看设备位置(iPhone、iPad、Mac、AirPods)
  • 持续监测宠物或物品的活动轨迹(AirTag 巡逻路线)
  • 方法 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
    

    用视觉分析每张截图以提取坐标,然后汇总出路线。

    限制说明

  • FindMy 没有 CLI 或 API —— 必须使用 UI 自动化
  • AirTag 仅在「查找」页面保持显示时才会更新位置
  • 定位精度取决于「查找」网络中附近的 Apple 设备
  • 截图需要屏幕录制权限
  • AppleScript UI 自动化在不同 macOS 版本间可能失效
  • 规则

  • 追踪 AirTag 时让「查找」应用保持在前台(最小化后更新会停止)
  • 使用 vision_analyze 读取截图内容 —— 不要试图解析像素
  • 对于持续追踪,使用 cronjob 定期截图并记录位置
  • 尊重隐私 —— 只追踪用户拥有的设备/物品
  • 安装指南

    复制下方命令,在终端运行即可安装:

    # 安装到当前项目
    npx skills add findmy
    # 全局安装 — 所有项目可用
    npx skills add findmy -g
    ⚡ 一键安装到 GenHub

    需已安装 GenHub 桌面端

    使用指南

    安装完成后,在对话框中直接使用此技能。

    基本信息
    作者 Community 分类 efficiency 难度 Intermediate 时长 1 hour
    🛠️ 安装命令
    # 安装到当前项目
    npx skills add findmy
    # 全局安装
    npx skills add findmy -g

    发表评论