Issue with startApplication and closeApplication on iOS

**OS **OSX High Sierra

Katalon Studio Version 5.2

## Environment (for Mobile testing)

* Appium version 1.7.1

* Mobile platform/version under test iOS 11.2

* Simulator iPhone 5S

* Xcode version (for iOS) Xcode 9.2

## Steps to reproduce -

Launch your app with Mobile.startApplication (appPath, TRUE)

Close your app with Mobile.closeApplication()

## Expected Behavior -

I am expected to have the app uninstalled when I close it: https://docs.katalon.com/display/KD/[Mobile]+Start+Application

## Actual Behavior -

App is closed but still not installed. I need to have a way to uninstall my app without restarting the sim. Moreover solution has to work also on real devices

quentin said:

**OS **OSX High Sierra

Katalon Studio Version 5.2

## Environment (for Mobile testing)

* Appium version 1.7.1

* Mobile platform/version under test iOS 11.2

* Simulator iPhone 5S

* Xcode version (for iOS) Xcode 9.2

## Steps to reproduce -

Launch your app with Mobile.startApplication (appPath, TRUE)

Close your app with Mobile.closeApplication()

## Expected Behavior -

I am expected to have the app uninstalled when I close it: https://docs.katalon.com/display/KD/[Mobile]+Start+Application

## Actual Behavior -

App is closed but still not installed. I need to have a way to uninstall my app without restarting the sim. Moreover solution has to work also on real devices

I notice when you pass TRUE value into ‘Start Application’ keyword, it will set fullReset capabilities to true:

As described in this document, fullReset does not work for REAL device, so you can’t uninstall your app automatically using real iOS device

1 Like

Thanks for the info for real devices, but what about simulators? When I close the app, it is not uninstalling the app either.

This explains much better: It will destroy your sim :slight_smile:

Ok I see, I tried also to implement an after hook with removeApp method, but app was not removed, but I found the bug ticket in appium side: https://github.com/appium/appium/issues/9940
I guess we can close this ticket!
Thanks!

This still works inconsistently between iOS and Android - I don’t think that Appium can make a change to the underlying way that iOS apps are installed.

The Katalon documentation for startApplication should be updated to reflect the different behavior on iOS.

As a workaround, I wrote a library that tries to make uninstalling/clearing an app more consistent between iOS and Android (still can’t uninstall from iOS reliably, but you can clear the data):

https://github.com/detroit-labs/katalon-mobile-util#how-to-use-device

This gives the testers control over whether the app is cleared before the tests run or after (or both).