I think for Android:-
Activity activity = new Activity(“app package goes here”, “app activity goes here”);
(AndroidDriver) driver.startActivity(activity);
would serve the purpose.
For iOS, there is no such direct method but in Java + TestNG you can specify 2 test set in testing.xml file where each test set point to corresponding app, this way you can switch b/w apps without starting a new driver, below is the pseudo code for same
suite
test name = "Test set 1"
parameter name = “bundleID” value = "app1 bundled"
other parameters
/test
test name = "Test Set 2"
parameter name = “bundleID” value = "app2 bundled"
other parameters
/test
/suite