Ross McFadyen is said to have targeted the Police Scotland vehicle on Monday, June 14, 2021.
He is also accused of culpably and recklessly failing to tell Police Constables Derek Deacon and Cameron Gilchrist, who were searching him, that he had uncapped needles on him, thereby endangering the officers.
He was represented by defence solicitor Amy Spencer during the private hearing, where he made no plea to the two charges he faces.
How to get the latest crime news with the Daily Record
The Daily Record and Sunday Mail have always been at the forefront when it comes to reporting crime in Scotland.
But did you know all the ways you can stay informed of the top crime and courts headlines?
We share live crime news and exclusive court stories as well as features and columns on historical cases, keeping our readers informed and updated across the country.
Sheriff Lindsey Kooner continued the case and released McFadyen on bail with a curfew.
No future court dates have been set.