Schweinsteiger spot on in Germany victory
Germany looked sluggish in the first half but substitutes Thomas Mueller, Marko Marin and Cacau added pace after the interval as Germany struck three times in 27 minutes.
Cacau, who replaced out-of-form striker Miroslav Klose and set up Philipp Lahm's equaliser, and Mueller, who came on for midfielder Piotr Trochowski and won Germany's second penalty, staked strong claims for starting spots.
"In the second half, despite three weeks of preparation, we increased the tempo again and that was good to see," Germany coach Joachim Loew told reporters.
"The potential is there. Everyone has worked hard and I think we have a good team, the mood is good in the team and we can play a good tournament."
Defender Lahm, making his debut as Germany captain, helped give the Bosnians a 15th-minute lead when he tried to clear the ball but it struck striker Edin Dzeko and deflected over Germany keeper Manuel Neuer.
While Germany's defensive formation, particularly central defender Per Mertesacker, looked far from stable, their holding midfield of Schweinsteiger and Sami Khedira proved effective.
Loew took toothless Klose off for Cacau and the switch paid dividends when he fed 26-year-old Lahm, who will become Germany's youngest World Cup captain after succeeding injured Michael Ballack, for the equaliser in the 50th minute.
Seconds later Cacau set up Mesut Ozil but the midfielder hit the crossbar with a chipped shot.
Marin and Mueller wreaked havoc in the Bosnian defence before being awarded a penalty each in the 73rd and 77th minute which Schweinsteiger calmly converted.
"In the second half we created many, many chances. So after this match we will fly to South Africa with a lot of joy and confidence," Lahm told reporters. "We are all fit and so I will travel with a good feeling to South Africa."
Germany have been drawn in Group D of the June 11-July 11 World Cup in South Africa, alongside Serbia, Ghana and Australia.