The Spaniard, who left the German champions at the end of the season after winning a league and cup double, takes his new side back to his previous employers on July 20.
“Playing Bayern Munich is always a great occasion and this match has the added excitement of our new head coach Pep Guardiola returning to play with Manchester City against his former club,” City chief executive Ferrran Soriano said.
“Bayern will provide fitting opposition as our team continues its pre-season preparations and we will be able to connect with our fans in Germany.”
Bayern will be managed by former Real Madrid, AC Milan and Chelsea coach Carlo Ancelotti.
Follow us on Twitter @NatSportUAE
Like us on Facebook at facebook.com/TheNationalSport