Is there a way quit and reopen the app?

Hi everyone,

I need to test UTM parameters in my app. As per google developer article I need to install and quit the app. Then I have to run the adb shell command to set the UTM parameters and then I can run my test.

driver.closeApp(); just minimises the app.
driver.resetApp(); reinstalls the app and reset all the settings. So whatever commands I run before launchapp are useless.
driver.launchApp(); also does the same thing. After this command the app opens as if it was being opened for the first time so i guess this is also reinstalling the app.

My requirement is Kill the app --> run a command --> reopen the app. This cannot be done by above methods. Is there any other way?

I am using Appium 1.4.13 GUI mode (not commandline) on ONX 10.11.2 El Capitan for testing my android app.

Thanks in advance.

1 Like

Alternative approach

  1. In setup Install the application with adb commands and setup the UTM commands first then write the capabilities.
  2. Do not provide the app capability, it will start the preinstall app. perform the action you want.

Hi pr4bh4sh,

Sorry I edited the above post since I realised my requirement is a little different. Can you help?

After setting the UTM parameter execute below command
adb shell am force-stop