We were planning to taxi/Uber, but the waits were like 40 min to get from the harbor to the royal mile. (We had tendered to the harbor, can't remember the name of the harbor.) There were volunteers there that had general tourist information and also a rep from a bus company. You can take a City bus for a few pounds to the royal mile area, or buy a ticket on the spot for a hop on/off bus right there. (It was a blue and yellow bus, not the red;the stop was a 90 second walk from the tender).
Later, I was able to get a taxi (i think from Edinburgh city taxi--download the app and enter payment info in advance) within a few min to take us back to the harbor. We could have waited for the bus again, but the traffic was so bad.
The 'on your own' bus leaves and comes back at rigid times. That might work for you or you may find that you would want more flexibility with a bus or taxi. depends also on the size of your party (if you are a party of 1 and don't want the Lothian city bus), the excursion might make sense. If you are two or three people, the cost might be a wash.