The Germans, already qualified for the Nations League quarter-finals set for March, crushed Bosnia and Herzegovina 7-0 on Saturday for a statement victory that secured first place in Group A3 ahead of the Netherlands with a game to spare.
His retirement follows those of Toni Kroos and Thomas Mueller.
Some 60,000 Scottish fans are expected in Munich around the opening fixture, according to local officials.