How to start second test case not from Onboarding/splash screen

I want to execute following scenario:
Test Case 1: should start from onboarding screen and test case will interact with it. (like we have downloaded the app for the first time.) now test case 2 should not see the onboarding screen.( like we dont see when we open the app for second time). how to emulate this?

If we minimize the app and maximize it again then we do not see splash screen.

If u use android app then this option will work.

Minimize app after test case 1 and invoke app my maximizing it

minimize the app? means - driver.quit or driver.close? or you have something else in mind?

testcase1 executed
then
// Press Home Key
_driver.pressKeyCode(AndroidKeyCode.HOME);

	// KEYCODE_APP_SWITCH
	_driver.pressKeyCode(0x000000bb);

           // brings app to current focus without launching it
	_driver.findElementByAccessibilityId("appName").click();

Now, execute testcase2

question 1. what does this line means:
// brings app to current focus without launching it
_driver.findElementByAccessibilityId(“appName”).click();

question 2: how to manage capabilities for next test case. because capability expect Onboadring activity. Or are you not initializing the driver again?

Why are you launching app for every test case ?

Just launch app once and execute multiple test cases using testng.xml for a single session.

@amitjaincoer191
thats really i want to do. Can you share your code where u initialize Appium and also the code of AfterSuite or AfterTest where you close the app or press home button?

There is workaround. So In
test case 1: Provide apk path to your capability
test case 2: Do not mention application path, just provide launch activity… that will launch existing app without instlling new one.

Thanks,
Priyank Shah