How to reset app with appium script

hi there, any idea to reset the app on katalon studio 10?

i used this reference but not work

https://docs.katalon.com/katalon-studio/manage-projects/set-up-projects/mobile-testing/reduce-execution-time-in-mobile-testing-in-katalon-studio

1 Like

Hi @joko,

Thank you for sharing your issue.

To reset the app in Katalon Studio 10, try these approaches:

1. Use startApplication() with true parameter
Ensure you launch the app with startApplication(appPath, true), which forces a reset.

Mobile.startApplication('path/to/your/app.apk', true)

2. Use adb command (for Android)
If resetting via Katalon doesn’t work, try running:

adb shell pm clear your.app.package.name

This clears app data and resets it.

3. Uninstall & Reinstall the App
Manually uninstall before re-running tests or use:

Mobile.uninstallApp('your.app.package.name')
Mobile.startApplication('path/to/your/app.apk', false)

Let me know if it works/not. Thank you

@joko resetApp() was deprecated on new versions on appium. I am not sure if you are trying to automate iOS or android apps but either way you can instead use terminateApp(appID) and activateApp(appID)

the code from the link you attached here would then be:

import com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory
import io.appium.java_client.AppiumDriver
AppiumDriver driver = MobileDriverFactory.getDriver();
driver.terminateApp(appID)
driver.activateApp(appID)

If you want to clear the data I would suggest either using clearApp(appID) and activateApp(appID) for iOS or adb commands for android as @Elly_Tran suggested.

Here is the link to the appium driver docs:

I don’t want to uninstall, it will make the execution time much slower, imagine if I have 70 scenarios and in each scenario I just need to reset the app to go back to the beginning without doing a reset