# Resetting app test data for android emulator/ios simulator

**URL:** <https://discuss.appium.io/t/resetting-app-test-data-for-android-emulator-ios-simulator/38067>\
**Category:** Support\
**Created:** [December 18, 2022, 6:38am UTC](https://discuss.appium.io/t/resetting-app-test-data-for-android-emulator-ios-simulator/38067 "2022-12-18T06:38:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sherrylene\_Gauci](https://discuss.appium.io/user_avatar/discuss.appium.io/sherrylene_gauci/32/10862_2.png) [@Sherrylene\_Gauci](https://discuss.appium.io/u/Sherrylene_Gauci)\
**Post date:** [December 18, 2022, 6:38am UTC](https://discuss.appium.io/t/resetting-app-test-data-for-android-emulator-ios-simulator/38067/1 "2022-12-18T06:38:04Z")

</div>

Hi  
I have some feature files which require the user to login in order to execute functionality in the app. I would like each test to start from fresh and login however after the first test is run, I can see that when the app is reopened the user is still logged in. I have tried a combination of `noReset` and `fullReset` values however `noReset` doesnt seem to do anything - app launches, waits for a bit on login screen and closes without the tests actually running till the end and with `fullReset` the first test passes but the second one doesn’t. Can someone help? I have been trying so many different solutions and nothing is working.

I can’t see any specific errors in the console so it’s harder to debug what might be wrong.This text will be hidden

---

<div class="post-metadata">

**Author:** ![wreed](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/919ad9/32.png) [@wreed](https://discuss.appium.io/u/wreed)\
**Post date:** [December 18, 2022, 5:38pm UTC](https://discuss.appium.io/t/resetting-app-test-data-for-android-emulator-ios-simulator/38067/2 "2022-12-18T17:38:27Z")

</div>

The reset strategies table might help:

[https://appium.io/docs/en/writing-running-appium/other/reset-strategies/](https://appium.io/docs/en/writing-running-appium/other/reset-strategies/)

---

<div class="post-metadata">

**Author:** ![Sherrylene\_Gauci](https://discuss.appium.io/user_avatar/discuss.appium.io/sherrylene_gauci/32/10862_2.png) [@Sherrylene\_Gauci](https://discuss.appium.io/u/Sherrylene_Gauci)\
**Post date:** [December 19, 2022, 12:47am UTC](https://discuss.appium.io/t/resetting-app-test-data-for-android-emulator-ios-simulator/38067/3 "2022-12-19T00:47:04Z")

</div>

Hi wreed,  
As I mentioned I have tried the reset strategies with no luck.

---

<div class="post-metadata">

**Author:** ![wreed](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/919ad9/32.png) [@wreed](https://discuss.appium.io/u/wreed)\
**Post date:** [December 19, 2022, 1:59am UTC](https://discuss.appium.io/t/resetting-app-test-data-for-android-emulator-ios-simulator/38067/4 "2022-12-19T01:59:46Z")

</div>

Honestly your description sounds like a misunderstanding of how fullReset and noReset work. You state clearly that noReset doesn’t do anything, which I know is not true.

Maybe share your code?

---

<div class="post-metadata">

**Author:** ![Sherrylene\_Gauci](https://discuss.appium.io/user_avatar/discuss.appium.io/sherrylene_gauci/32/10862_2.png) [@Sherrylene\_Gauci](https://discuss.appium.io/u/Sherrylene_Gauci)\
**Post date:** [December 20, 2022, 12:58am UTC](https://discuss.appium.io/t/resetting-app-test-data-for-android-emulator-ios-simulator/38067/5 "2022-12-20T00:58:49Z")

</div>

From my understanding, `noReset:false` should clear the app data before each test. However, the second test fails because on app launch, the user is still logged in. If app data is cleared, shouldn’t the test start from fresh? It mostly looks like the app is killed as soon as the tests start. I also haven’t seen appium logs in the VS code terminal to help me understand what could be wrong.

Could you explain your understanding of `noReset` and `fullReset`? I’d be happy to get a second opinion. I’ve been researching all over the internet for the last 3 days.

With regards to the code, there’s not really much to it. The tests are logging in and looking for some elements on a specific screen in the app. There are no logout steps or anything like that and I’m also not using any after hooks logic.

---

<div class="post-metadata">

**Author:** ![wreed](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/919ad9/32.png) [@wreed](https://discuss.appium.io/u/wreed)\
**Post date:** [December 20, 2022, 4:57am UTC](https://discuss.appium.io/t/resetting-app-test-data-for-android-emulator-ios-simulator/38067/6 "2022-12-20T04:57:31Z")

</div>

> [@Sherrylene\_Gauci](#):
>
> With regards to the code, there’s not really much to it. The tests are logging in and looking for some elements on a specific screen in the app. There are no logout steps or anything like that and I’m also not using any after hooks logic.

Lots of unknowns here. iOS/Android/Both? Language? Test Framework?

You are using VS code so maybe Java? If you are using Java, maybe TestNg?

> [@Sherrylene\_Gauci](#):
>
> It mostly looks like the app is killed as soon as the tests start.

This is where it would be good to see some code and possibly a log. Best way to share a log is with a [git gist](https://docs.github.com/en/get-started/writing-on-github/editing-and-sharing-content-with-gists/creating-gists). I’d like to help you, but I need you to help me help you.

I feel that there is some problem beyond just reset strategies. Reset strategies should not cause the app to be killed as soon as the test starts.

---

<div class="post-metadata">

**Author:** ![ido\_oserovitz](https://discuss.appium.io/user_avatar/discuss.appium.io/ido_oserovitz/32/9832_2.png) [@ido\_oserovitz](https://discuss.appium.io/u/ido_oserovitz)\
**Post date:** [December 22, 2022, 6:06am UTC](https://discuss.appium.io/t/resetting-app-test-data-for-android-emulator-ios-simulator/38067/7 "2022-12-22T06:06:02Z")

</div>

just set **fullReser:true** it should do the work if I understood you test case correctly, don’t try to combine it with noReset if you just want the app to relaunch then, you should get a fresh test with login data cleared.

---

<div class="post-metadata">

**Author:** ![hamza\_bouabid](https://discuss.appium.io/user_avatar/discuss.appium.io/hamza_bouabid/32/10537_2.png) [@hamza\_bouabid](https://discuss.appium.io/u/hamza_bouabid)\
**Post date:** [April 26, 2023, 10:02am UTC](https://discuss.appium.io/t/resetting-app-test-data-for-android-emulator-ios-simulator/38067/8 "2023-04-26T10:02:00Z")

</div>

Hi, I am facing the same issue, any solution so far, the logout from the app is hard as in each test case it dives deep inside the views of the app
