How to clear app Data in Android device while executing it from Cloud Devices or in Cloud Grid Node

Hi,

While executing our automation scripts through Appium Studio in CLOUD ANDROID DEVICES, then what will will be the code to clear the APP DATA in android devices in cloud, as the code [[ Runtime.getRuntime().exec("adb shell pm clear " + appPackage); ]] will work if the mobile device is connected to CPU physically and executed over Appium Studio. But for CLOUD ANDROID Devices how do the ADB SHELL commands can be executed to clear app data.

But for SEETEST AUTOMATION tool we have the command [[ driver.application(“com.experitest.simplebrowser”).clear(); ]] which will perform clear app data, which is not working in Appium Studio version 10.9.

Can you please suggest.

Thanks

Hi,

If you have specified your app in the capabilities section, you clean wipe the application data by adding the
noReset capability dc.setCapability(“noReset”,true)
https://docs.experitest.com/display/AS/Application+Setup

if you want to reset the data during your tests you can use

driver.resetApp() ;

after you specified the app in the capabilities

Thanks Tom, for providing the suggestion . The driver.resetApp(); code is working for clearing the app data for the mobiles executing it through cloud.

awesome :wink: happy I could assist