hi,
I have the same requirement with you. And my solution is define one super testcase class, in this class I have a flag to confirm which driver to use the code like:
public static boolean ANDROID_PLATFORM = true;
if (ANDROID_PLATFORM) {
capabilities.setCapability("unicodeKeyboard", "True");
capabilities.setCapability("resetKeyboard", "True");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),
capabilities);
}else{
capabilities.setCapability("deviceName", "iPhone 6");
driver = new IOSDriver(new URL("http://10.58.26.241:4723/wd/hub"),
capabilities);
}