Germany will host Latvia on June 7 in a friendly ahead of the European Championship, the German FA announced Friday.
Joachim Loew's team will face Latvia in Duesseldorf eight days before Germany play world champions France in their opening group game in Munich.
The friendly will be part of Germany's pre-tournament training camp and another warm-up game is also expected to be announced.
On Tuesday Loew confirmed he will step down as head coach after the finals, which run from June 11-July 11. Germany have also been drawn alongside holders Portugal and Hungary in Group F.
Germany are currently ranked 13th in the world after being routed 6-0 by Spain last November in the Nations League, while Latvia are down in 136th place.
All football matches in Germany are currently being played behind closed doors due to the Covid-19 pandemic.
Germany team director Oliver Bierhoff hopes spectators will be allowed back into stadiums by early June.
"We would really like to have fans back, especially for the last match before the tournament," said Bierhoff in a statement.
"That would certainly be another motivational boost for all of us before we start the European Championships."
Germany play Iceland, Romania and North Macedonia in World Cup qualifiers at the end of March.