How to switch between 2 native applications

When trying to switch from native app to another native app I’m getting Method is not yet implemented on Driver.getWindowHandle()
How can I switch app ? without close and start new driver ?

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

test name = “Test set 1”
parameter name = “bundleID” value = “app1 bundled”
other parameters

test name = “Test Set 2”
parameter name = “bundleID” value = “app2 bundled”
other parameters


Thanks for reply
My problem is that my second app have no permission to use activity for loading the app, so can not use start activity(when tried it I got error that activity does not exist because of no permission). I looking for a way to connect appium driver to tha app when it already on focus