5 May 2016 Last updated at 08:32 BST
The cops even threw in some Scottish country dancing to add their own twist.
The Scottish force has now challenged police in London and Toronto, Canada, to get their groove on too.
The viral craze sees people recording themselves dancing to My Boo by Ghost Town DJs, posting the video on social media and then challenging others to join in.
Police officers in Scotland's capital city, Edinburgh, have taken on the Running Man Challenge.