Although Edinburgh, like the other Royal Burghs of Scotland, used armorial devices on its seals and in other ways from early times and certainly from the 14th century, the 'achievement' or coat of arms was not formally granted by the Lord Lyon King of Arms until 1732. The arms were used by Edinburgh Town Council until the reorganisation of local government in Scotland in May 1975, when the council was succeeded by The City of Edinburgh District Council and a new coat of arms, based on the earlier one, was granted.
The castle has long been a symbol for Edinburgh, the Castle Rock having been fortified since Neolithic times
The crest probably derives the office of Ardmiral of the Forth held by the Lord Provost - an anchor wreathed about with a cable all proper (that is, in natural colours) set on a wreath of the colours. This wreath or torse represents cloth coloured by the city's livery, silver on one side and black on the other, and twisted so as to show three twists of each colour.
Above the anchor is the motto, 'NISI DOMINUS FRUSTRA', associated with Edinburgh since 1647. The interpretation is, 'Except the Lord in Vain' and is a normal heraldic contraction of a verse from the 127th Psalm:-
'Except the Lord build the house
Two figures or 'supporters' flank the shield. On the 'dexter' (ie the viewer's right) stands a doe. The adoption of the maiden as a supporter probably derived from the fact that Edinburgh Castle was known, certainly in the 13th century if not earlier, as 'Castrum Puellarum' (Castle of the Maidens). Although this name was probably a corruption of a Gaelic or Brythonic name sounding like 'Maiden' but meaning something else, there is a legend that in the Dark Ages the Castle was used as a safe residence for royal princesses, and it is also believed that it housed a nunnery in this period. The doe or hind is associated with St Giles, the city's patron saint. Until the Reformation, they were often shown together on the civic seals. The earliest representation of the maiden still extant dates from 1640, carved on a stone in Parliament Hall.
Source: Heraldry of the World