Kill app after timout(more than 30 minutes) does not work because appium flags an exception


I have a test case on android in which I have to put the app in the background for more than 30 minutes, it does not work because appium flags an exception after its timeout (–command-timeout 2 400 000 does not work I think …).
What is the max timeout I can set in appium or is there any solution for this?
Note : I m using appium on Samsung Galaxy Tab S2
Thank you in advance,

–command-timeout was replaced by capability newCommandTimeout.


capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 3600);
1 Like

thank you, but with the new command I can set the timeout to 2 400 000 secs ?

Well…| I suppose you can. But that’s over 660 hours of timeout. You going of vacations a whole month while the app is in background ? :smiley:

1 Like

OK, but this is the way I did : capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 2400000);
in the developer setting -> custom server flags .I am right , sorry I m quite new :smile:

uhmm… I just seen you are using appium 1.4.16 so old tag should work.

Anyway you should upgrade your appium.

1 Like

When i need long inactivity test i just do in loop every 30sec driver.getPagersource(). Thus appium server continues to work normally without timeout.

1 Like


I have added it like this :

private static final int COMMAND_TIMEOUT = 2400000;
desiredCapabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, COMMAND_TIMEOUT);

Eclipse log :
2016-08-11 16:42:29,086 INFO Start Appium server.
2016-08-11 16:42:29,088 WARN APPIUM_SERVER_NODE environment variable wasn’t set. Please set it before starting the tests.
2016-08-11 16:42:29,089 WARN If you use Eclipse please make sure whether you have started Eclipse by the following command: ‘open /Applications/eclipse/’
2016-08-11 16:42:29,089 WARN Eclipse can’t reach environment variables properly if you open it another way (eg. from the Icon in the Dock)
2016-08-11 16:42:29,089 WARN The Appium webdriver instance is null. Thus the closure of the driver is skipped.

What does this means and I did it in a correct way?

Any help please?