App uninstall after each test

I am new to mobile automation and i have set up ios testing framework using mocha and using nodejs for development, when ever i run my script, Simulator opens app execute script after executing it will uninstall app. I have to overcome this issue, which code should i be using to overcome this issue.

thanks in advance

Regards
Prathyush R J

@prathyushrj You can set the appium capabilities to neither reinstall or reset

no-reset = true
full-reset = false

Thank you it worked.

also i need to capture screenshot for failed testcases is there a way to do it?

thanks in advance

@prathyushrj I use java Runtime class to execute system commands. You can use it like :

Runtime.getRuntime().exec(“idevicescreenshot -u “+udid+” temp.tiff”);
Another way of use with two commands. no need to use temp file.

idevicescreenshot -u $1 screenshot.png
sips -s format png screenshot.png --out screenshot.png

@PositiveCrux thank you for quick reply i am using

protractor, jasmine and javascript for one project and
selenium 3, mocha and javascript for other projects

any commands for the above setup?

Thanks in advance

no-reset = true
full-reset = false
I know with the above capabilities, app will be re-installed before the test starts and uninstalled after the test execution.
Is there a way to install the app before the test execution but do not uninstall the app at the end of test execution?