Skip to content

Instantly share code, notes, and snippets.

@paddelkraft
Last active November 10, 2022 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save paddelkraft/9175059 to your computer and use it in GitHub Desktop.
Save paddelkraft/9175059 to your computer and use it in GitHub Desktop.
Copy Garmin Training History Mac
#!/bin/bash
destination_dir=~/Documents/training/garminData/
#device=$(ls ~/Library/Application\ Support/Garmin/Devices/)
for device in $(ls ~/Library/Application\ Support/Garmin/Devices/)
do
echo "Copy history files for Device $device"
cp ~/Library/Application\ Support/Garmin/Devices/$device/History/*.TCX $destination_dir
done
@paddelkraft
Copy link
Author

This script is for MAC OSX

Garmin ANT Agent is hiding the training data that it downloads from your Garmin device in a folder you can't easily get to with Finder. And then it uploads them to Garmin Connect.

If you want to have a backup of your files that you can see or if you want to upload them to Strava you need to go to Garmin connect and export every individual TCX file and it is a real pain. This got me really annoyed

This little script copies your TCX files from their hiding place and puts them in a directory/folder of your liking. You need to use the terminal to do this but ill try to make the instructions so that anyone that does know how handle files in Finder open an editor and to start The terminal and type simple commands should be able to do it

SETUP

  • Create a directory where you want the files to be copied to (Documents/training/garminData/) in my case
  • Paste the code in this example into an empty file with an editor or download it Update the destination_dir if you want the files somewhere else then Documents/training/garminData/ and save the file as
    garminHistoryCopy.sh (or anything else that makes sense to you) in my case i saved it in my Home directory (can be found in finder by going to the Go menu and click Home)
  • Open the Terminal and type chmod +x garminHistoryCopy.sh or whatever you called your file (the terminal opens in your Home directory)
  • Close the Terminal

USE

  • Sync the data from your Garmin Device with Garmin Ant Agent
  • Open the terminal and type ./garminHistoryCopy.sh if all goes well you should get output that looks like this
    Copy history files for Device 3865553037
  • Go to the destination directory and you should find your files there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment