This is also good for cruise passengers, a lot less expensive than the ship’s excursion. We were on Princess cruise, and the ship was docked at South Queensferry port, about 1 hour away from Edinburgh city. There is a public bus X99 for £6 that picks up cruise passengers at port and directly drops off at St Andrews Square (every 20 min I think). Then we walked about 10 min to Waverly Bridge to catch this HOHO bus. I suggest to get off at #6 stop, which is right at the gate of Edinburgh castle. It’s good to do this early in the morning til noon, but may skip this in the afternoon as the traffic is very slow in the city center. After our own tour, we just walked about 15-20 min from Royal mile back to St Andrews square to catch bus X99. We left National museum at 3pm and got back to the ship by 4:30pm.
Read more about Edinburgh Hop-On Hop-Off Bus Sightseeing Shore Excursion 2019 - https://www.viator.com/tours/Edinburgh/Edinburgh-Shore-Excursion-City-Sightseeing-Hop-On-Hop-Off-Tour/d739-2065PRTEDI?mcid=56757