# How to start Appium for iOS from screen which is not launch screen

**URL:** <https://discuss.appium.io/t/how-to-start-appium-for-ios-from-screen-which-is-not-launch-screen/8034>\
**Category:** Support\
**Created:** [January 21, 2016, 5:54pm UTC](https://discuss.appium.io/t/how-to-start-appium-for-ios-from-screen-which-is-not-launch-screen/8034 "2016-01-21T17:54:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shankar\_garg](https://discuss.appium.io/user_avatar/discuss.appium.io/shankar_garg/32/1285_2.png) [@shankar\_garg](https://discuss.appium.io/u/shankar_garg)\
**Post date:** [January 21, 2016, 5:54pm UTC](https://discuss.appium.io/t/how-to-start-appium-for-ios-from-screen-which-is-not-launch-screen/8034/1 "2016-01-21T17:54:47Z")

</div>

platform : iOS

Screen 1: Default screen that is visible on App launch

Screen 2: This screen does not come by default and may be 2-3 steps down the line after screen1.

Now i want to start the Appium session with Screen 2 and not screen 1. How to do that?  
I know this can be done using “appActivity” while initialising appium instance. Looking for an alternative for iOS.

---

<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:** [January 21, 2016, 6:06pm UTC](https://discuss.appium.io/t/how-to-start-appium-for-ios-from-screen-which-is-not-launch-screen/8034/2 "2016-01-21T18:06:44Z")

</div>

I don’t think that this can be done on iOS. My suggestion would be to use a setup or before method to get the app into the state you need for testing.

---

<div class="post-metadata">

**Author:** ![amitjaincoer191](https://discuss.appium.io/user_avatar/discuss.appium.io/amitjaincoer191/32/5339_2.png) [@amitjaincoer191](https://discuss.appium.io/u/amitjaincoer191)\
**Post date:** [January 22, 2016, 12:04pm UTC](https://discuss.appium.io/t/how-to-start-appium-for-ios-from-screen-which-is-not-launch-screen/8034/3 "2016-01-22T12:04:50Z")

</div>

Hello Shankar Garg Sir,

> > > I know this can be done using “appActivity” while initializing appium instance  
> > > Does this means we provide Screen 2 activity name in Desire Capability while creating appium Instance ?  
> > > But I have impression that it is must to pass only Launchable activity … Please correct me if I am wrong.

Can u share your first solution please for our learning ?

Regards,  
Amit Jain

---

<div class="post-metadata">

**Author:** ![shankar\_garg](https://discuss.appium.io/user_avatar/discuss.appium.io/shankar_garg/32/1285_2.png) [@shankar\_garg](https://discuss.appium.io/u/shankar_garg)\
**Post date:** [January 23, 2016, 12:54pm UTC](https://discuss.appium.io/t/how-to-start-appium-for-ios-from-screen-which-is-not-launch-screen/8034/4 "2016-01-23T12:54:05Z")

</div>

@wreed: yeah, we are doing that already. just wanted to confirm there is no alternative like Android.

---

<div class="post-metadata">

**Author:** ![shankar\_garg](https://discuss.appium.io/user_avatar/discuss.appium.io/shankar_garg/32/1285_2.png) [@shankar\_garg](https://discuss.appium.io/u/shankar_garg)\
**Post date:** [January 23, 2016, 12:58pm UTC](https://discuss.appium.io/t/how-to-start-appium-for-ios-from-screen-which-is-not-launch-screen/8034/5 "2016-01-23T12:58:38Z")

</div>

@amitjaincoer191: Please refer below code:  
capabilities.setCapability(“browserName”, “”);  
capabilities.setCapability(“platform”, “Android”);  
capabilities.setCapability(“deviceName”, “AndroidPhone”);  
capabilities.setCapability(“platformVersion”, “9.0”);

\*\* capabilities.setCapability(“appPackage”, “com.xxxx.xxxx.xx”);\*\*  
\*\* capabilities.setCapability(“appActivity”, “com.xxx.xxx.MainActivity”);\*\*

```
             final File appDir = new File("/Users/xxxx/xxx/xxxx");
	    final File app = new File(appDir, "xxxxx.apk");
                capabilities.setCapability("app", app.getAbsolutePath());

	    driver = new AndroidDriver(uri, capabilities); 

```

appPackage and appActivity can be used to define from where to start android driver.

---

<div class="post-metadata">

**Author:** ![amitjaincoer191](https://discuss.appium.io/user_avatar/discuss.appium.io/amitjaincoer191/32/5339_2.png) [@amitjaincoer191](https://discuss.appium.io/u/amitjaincoer191)\
**Post date:** [January 23, 2016, 1:17pm UTC](https://discuss.appium.io/t/how-to-start-appium-for-ios-from-screen-which-is-not-launch-screen/8034/6 "2016-01-23T13:17:34Z")

</div>

Does it means activity we pass while creating session with appium server is not mandatory to be launchable activity of app ?? Please clarify ?

---

<div class="post-metadata">

**Author:** ![shankar\_garg](https://discuss.appium.io/user_avatar/discuss.appium.io/shankar_garg/32/1285_2.png) [@shankar\_garg](https://discuss.appium.io/u/shankar_garg)\
**Post date:** [January 25, 2016, 8:12am UTC](https://discuss.appium.io/t/how-to-start-appium-for-ios-from-screen-which-is-not-launch-screen/8034/7 "2016-01-25T08:12:13Z")

</div>

yes. activity we pass while creating session with appium server is not mandatory to be launchable activity of app
