He was born at Brüx, a small Protestant community in Bohemia, to a Saxon father and a Bohemian mother. In 1626 the family had to flee Bohemia, during the Thirty Years' War, after it had become Catholic; they settled in Freiberg, Saxony, where Andreas must have received his musical education. He probably did not study with Composer Christoph Demantius, who was Kantor at Freiberg and the most significant musician in the city while Hammerschmidt was there; however he may have known him. Many famous Musicians of the early Baroque spent time in Freiberg but it is uncertain which of them taught Hammerschmidt; at any rate he received a superb musical training while there.
Hammerschmidt left Freiberg in 1633, through his mentor Stephan Otto, taking a post as organist for Count Rudolf von Bünau in Weesenstein, but returned to Freiberg the next year as an organist. He was married shortly after his return there, and of his six children three died in infancy. In 1639 he left Freiberg again, moving to Zittau, where he succeeded Christoph Schreiber as organist; he remained in Zittau at this post for the rest of his life. While musical life in Zittau was severely damaged by the Thirty Years' War, including the decimation of the choirs and general reduction in musical standards, Hammerschmidt survived; after the end of the war in 1648 musical life slowly regained its former high standard.
Some of his concertos are written for large ensembles, with diverse combinations of instruments and voices (for Example, the sets from Gespräche über die Evangelia of 1655–1656; this was long enough after the war that large ensembles were available again). He wrote these pieces for Sundays and church feast days; their structure and intent foreshadowed the later German church cantata, as exemplified most famously by Johann Sebastian Bach. Even Hammerschmidt's masses conform to the concertato style, and are best seen as concertos.
Exact records of his activities in Zittau are spotty, for the documents were burned in 1757 when the city was destroyed by the Austrians in the Seven Years' War; however Hammerschmidt during this portion of his career became one of the best-known composers in Germany, and the most famous representative of the concertato style of the generation after Heinrich Schütz. While well-respected and called on as an expert in many matters, he seems to have been prone to outbursts of rage, some of which involved him in brawls. He also seems to have profited well from his activities as a musician and civic leader, and evidently lived in some luxury, having a house in town as well as a country estate.
Hammerschmidt wrote motets, concertos and arias, and almost all of his output is sacred vocal music in the concertato style. According to Manfred Bukofzer (1947), he "watered down the achievements of Schütz for the multitude." Many of his compositions are in the form of the chorale monody, an adaptation of the early Baroque Italian form to a sacred, and specifically Protestant, purpose. Indeed Hammerschmidt represents the second generation of composers who distilled a native German Baroque tradition out of forms and styles imported from Italy.
Over 400 works by Hammerschmidt survive, in a total of 14 separate collections. The motets represent a more conservative style, as noted by Hammerschmidt himself, and the concertos—concertato pieces with opposing groups of voices and instruments—are in a current idiom.