The Scots actor, alongside Ewen Bremner, were filmed sprinting out of a shop and down the road in a modern-day recreation of the famous Trainspotting intro.
The pair, currently filming the sequel to the 1996 blockbuster, were seen sprinting out of Urban Outfitters near the west end holding a black iPad.
In the original movie, a considerably more youthful McGregor and Bremner are seen sprinting along Princes Street with stolen gear hidden under their jackets. The immortal “choose life...” speech is read by McGregor over the footage.
Onlookers crowded around to watch the scene unfold, with parts of the street temporarily fenced off throughout the morning.
Urban Outfitters - which had been transformed into an Apple store for the day - was the location for the opening sequence.
Bremner, who plays Spud in the film, could be seen wearing a green and yellow flowery shirt, leather jacket and trainers as he was the first to pelt out of the shop.
Close-up snaps show him grinning and pulling a funny face as he tried to run as fast as possible for the cameras.
He was shortly followed by McGregor, who donned a grey tshirt, navy jacket and black jeans as he sprinted closely behind.