St. Andrew's was founded in 1158, when the previous church St. Rule's became too small to accommodate the bishops there. The work on the church took close to 150 years to complete. It was consecrated in 1318 in the presence of Robert the Bruce.
The Scottish Reformation (1559-1560) ultimately brought an end to the cathedral. In June of 1559 John Knox (who is now buried under a parking meter in Edinburgh) preached a sermon at St. Andrew's parish church that worked the congregation into such a frenzy, that they went to the cathedral and destroyed anything they thought associated with the "popery". The friars in turn were all expelled from the priory.
Stone coffins, now exposed, in which the most important officers of the priory might have been buried.
St. Andrew's Flickr Album