This script logs the location data of AirTags using the Find My app on macOS. The data is saved in CSV format for further analysis.
- macOS
- The jq command-line tool
-
Clone this repository to your local machine.
-
Open the
airtag_logger.sh
file and edit the following variables to suit your needs:ORIG_ITEM_LOC
- the path to the originalItems.data
file (defaults to/Users/$USER/Library/Caches/com.apple.findmy.fmipcore/Items.data
).TEMP_ITEM_LOC
- the path to the temporaryItems.data
file (defaults to/tmp/airtag_tems.data
).STORAGE_LOG_LOC
- the directory where the log files will be saved (defaults to/Users/$USER/AirTag-logs/
).WAIT_REFRESH_FINDMY_SECONDS
- the number of seconds to wait before refreshing the Find My app (defaults to10
).WAIT_BETWEEN_LOOP_SECONDS
- the number of seconds to wait between each loop of the script (defaults to110
).DELETE_LOGS_AFTER_DAYS
- the number of days after which log files will be deleted (defaults to30
).
-
Run the
airtag_logger.sh
file using the following command:sh airtag_logger.sh
-
The script will run indefinitely until interrupted by the user. It will log the location data of all AirTags associated with your Apple ID every
WAIT_BETWEEN_LOOP_SECONDS
seconds. The log files will be saved in theSTORAGE_LOG_LOC
directory with filenames in the formatairtag-history-YYYY-MM-DD.csv
.
This script is licensed under the GPL-3.0 license.
Modified version of @icepick3000's AirtagAlex script.