The 28-year-old midfielder has agreed a one-year deal with Accies after his contract at Pittodrie ran out in the summer.
"I think he can bring a presence and goals to our team," Hamilton boss Billy Reid told the club's official website.
"Gary hitting the box can be a big asset for us.
"I felt we needed another addition in the centre of the park, with the loss of James Wesolowski and James McArthur from last season, and we will be missing Alex Neil at the start of the season.
"Gary is the first real attacking midfielder I've had since Stuart Taylor in our First Division-winning season.
"By his own admission I don't think he did as well as he could have at Aberdeen last season, but I know that he is raring to go just now. I'm pleased to add him to the squad."
McDonald began his career at Kilmarnock before moving to Oldham in 2006.
The midfielder joined Aberdeen in 2008 and left the Dons in the summer after his two-year deal expired.