Goals by Philipp Lahm and Mario Mandzukic either side of half-time were enough to give the European Champions another pre-season victory.
Guardiola believes the performance has set Bayern up well ahead of Saturday's German Super Cup clash with Borussia Dortmund, in a repeat of May's Champions League final.
"It was a good preparation for Borussia Dortmund," said Guardiola
"Barcelona are always a good team and they were a good test for us. We had our chances and we have to improve our finishing."
Meanwhile, Guardiola admits it was a treat to face the club he will always be associated with following his glittering success at the Nou Camp.
"It was a very special game for me," Guardiola added. "I spent my whole life as a player and coach of Barcelona.
"I'm very happy now and have nothing to complain about. I have been given a
very good side with Bayern."