With Appium 2 the CloseApp() and TerminateApp() methods were removed, instead I use TerminateApp() and ActivateApp() but with this the data persists and I want to delete it for the next test. note: I use capabilities.setCapability("fullReset", true);

With Appium 2 the CloseApp() and TerminateApp() methods were removed, instead I use TerminateApp() and ActivateApp() but with this the data persists and I want to delete it for the next test.
note: I use capabilities.setCapability(“fullReset”, true);

You can use https://github.com/appium/appium-uiautomator2-driver?tab=readme-ov-file#mobile-clearapp to reset the app data.
Another solution might be uninstall the app completely and install it again

use the clearApp() command but do not delete the credentials that I am using in the test.

How manually you clear app data? In same way you can clear using Appium commands.

The clearApp() method worked, I was implementing it wrong. The use of TerminateApp() was not necessary, the application closes when the test is finished. Thank you.