Capability or wait command to make driver wait until app launch

Hi all,

I have appium framework in Appium 2 and having capabilities like below.

UiAutomator2Options android =
                    new UiAutomator2Options()

            driver = new AppiumDriver(url, android);

Sometimes above code fails as app is taking time to launch in emulator and driver is invoked immediately. How make driver wait until app is launched.I used below command at last line but throwing synchronisation error sometimes and driver is not waiting properly.
// driver.manage().timeouts().wait(30000);

Same i need for iOS too? ->
try increase

  • appium:appWaitDuration (you have)
  • appium:appWaitForLaunch (you have)
  • appium:avdLaunchTimeout
  • appium:avdReadyTimeout
  • appium:uiautomator2ServerLaunchTimeout
  • appium:uiautomator2ServerInstallTimeout
  • appium:uiautomator2ServerReadTimeout

so many to tune ā€¦

1 Like

Thanks Iā€™m setting all for Duration.ofSeconds(200).Hope this is enough. Is there anything for iOS too?