Aramaic was probably introduced into North Arabia as an official written language by the last king of Babylon, Nabonidus. In 553 BC, he conquered Taymāʾ, Dadan (modern al-ʿUlā), Yathrib (modern Medina) and three other oases on the frankincense route and stayed at Taymāʾ for 10 years. Since Imperial (or Official) Aramaic was the administrative language of the Neo-Babylonian empire, it would almost certainly have been used by Nabonidus' officials in Taymāʾ, though we know that some of them could also write in Taymanitic, and some fragmentary cuneiform inscriptions from this period have also been found in the excavations. After Nabonidus returned to Babylon in 543 BC, it appears that Imperial Aramaic remained one of the written languages at Taymāʾ and seems gradually to have displaced Taymanitic.
The Persian empire of the Achaemenids, which succeeded the Babylonian, continued to use Imperial Aramaic in its administration, though, at present, there is very little evidence of an Achaemenid presence in North Arabia. However, recent excavations at Taymāʾ by a Saudi-German team have discovered that the Lihyanite rulers of Dadan ruled Taymāʾ at some point and the official inscriptions from this period are couched in Imperial Aramaic, rather than Taymanitic or Dadanitic.
After Alexander the Great's conquest of the Achaemenid empire in 330 BC, North Arabia appears to have been more or less independent and, as in other parts of the former empire, local developments of the Imperial Aramaic script took place in Taymāʾ and possibly elsewhere, though not — on present evidence — in Dadan. However, by the late first century BC the Nabataeans had absorbed much of north-west Arabia into their kingdom, and the Nabataean form of the Aramaic script — itself a local development from Imperial Aramaic — became the standard. The Nabataeans set up the city of Ḥegrā (modern Madāʾin Ṣāliḥ) just 20 km north of Dadan and left large numbers of monumental inscriptions and graffiti throughout north-west Arabia.
Although, some of the nomads of North Arabia continued to write in Ancient North Arabian scripts until probably the 4th century AD, Nabataean Aramaic was used as the common written language of the settled inhabitants from the first century AD onwards. Indeed, when the Romans set up inscriptions on a small temple at Ruwāfah in the wilds of north-west Arabia, to mark the levying of a military unit from one of the local tribes (the Thamūd), the texts were in Greek for the Roman side and Nabataean as the local written language.
Since Arabic appears to have remained a purely spoken language until probably the fifth century AD, it only appears in a handful of texts, e.g. when the writer wanted to make a point by his use of language, or did not have a very good grasp of Aramaic. In these cases, the Aramaic, Sabaic, Ancient North Arabian, or Greek alphabets had to be used. However, by the early fifth century in north-west Arabia, it appears that the Arabic language was being used to write in ink using the Nabataean script. This may have been because knowledge of the Aramaic language had faded and more and more people were discovering that it was possible to use the Nabataean script to express their spoken language (Arabic). We know that there must have been widespread use of the Nabataean script for documents in ink at this period because writing in ink is the stimulus for the development of a script. If a script is only used to carve on stone there is no pressure for development of letter forms and ligatures, apart from cosmetic changes dictated by fashion (as in the monumental Ancient South Arabian alphabet) and these are quite different from the developments we see in the Nabataean script. It was in this way that the Nabataean alphabet became widely used to express the Arabic language and developed into what we think of as the 'Arabic script'. From north-west Arabia, it appears to have spread to Syria in the late fifth century and it is there that the first inscriptions in what is recognizably the Arabic language and script are found in the sixth century.
For further reading see:
M.C.A.Macdonald, "Ancient Arabia and the written word"
L. Nehmé, "A glimpse of the development of the Nabataean script into Arabic based on old and new epigraphic material"