This is a script that fetches the locations of airtags from the local cache of the FindMy.app and creates *.gpx
files from them.
It's useful for tracking the history of an airtag's locations.
(Credits go to henrik242 for inspiring this.)
- a Mac computer (sorry Linux & other OS do not work) =(
jq
- your terminal app (e.g. iTerm2) or
/usr/sbin/cron
has FullDisk access
- If not already done, make the script executable:
$ chmod +x <PATH-TO-REPO>/airtag-to-gpx.sh
- The Find My.app must be running & remain open for regular updates of the local cache.
# generate gpx of all airtags
$ ./airtag-to-gpx.sh
# generate gpx of a specific airtag
$ ./airtag-to-gpx.sh <AIRTAG-NAME>
# e.g.
$ ./airtag-to-gpx.sh Wallet
The script runs only once and is meant to be used with a cronjob (or something similar). For testing you can run it indefinitely like this:
# runs every minute
$ while true; do ./airtag-to-gpx.sh; echo -n "."; sleep 60; done
OUTPUT_DIR
- default:
$HOME/Desktop/airtag-gpx
- Place where the
gpx
are saved to - Contains final
gpx
files (merged from all days)
TMP_DIR
- default:
$HOME/Desktop/airtag-gpx/tmp-data/
- Working directory
- Contains daily
gpx
files and other files
- Airtag names with whitespaces break the
jq
query- Can be mitigated by renaming airtags to something w/o whithespaces