# Appium iOS- How can I go to Home screen

**URL:** <https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956>\
**Category:** Support\
**Created:** [February 14, 2018, 7:24am UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956 "2018-02-14T07:24:24Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![Telmo\_Cardoso](https://discuss.appium.io/user_avatar/discuss.appium.io/telmo_cardoso/32/1435_2.png) [@Telmo\_Cardoso](https://discuss.appium.io/u/Telmo_Cardoso)\
**Post date:** [February 15, 2018, 10:52am UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956/21 "2018-02-15T10:52:52Z")

</div>

on real ios devices thats not possible. For simulator I think there are scripts around to do that. But if you just want to go to homescreen you dont need to tap the home button, just use the above command.

---

<div class="post-metadata">

**Author:** ![Shubham\_Agarwal](https://discuss.appium.io/letter_avatar_proxy/v4/letter/s/2bfe46/32.png) [@Shubham\_Agarwal](https://discuss.appium.io/u/Shubham_Agarwal)\
**Post date:** [February 15, 2018, 12:41pm UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956/22 "2018-02-15T12:41:14Z")

</div>

I have one doubt, above method will send the app in the background, but only for particular period of time which we will provide and in the process of sending app into background and then launching again after the provided time, how we will perform actions on homescreen between the process?

---

<div class="post-metadata">

**Author:** ![Telmo\_Cardoso](https://discuss.appium.io/user_avatar/discuss.appium.io/telmo_cardoso/32/1435_2.png) [@Telmo\_Cardoso](https://discuss.appium.io/u/Telmo_Cardoso)\
**Post date:** [February 15, 2018, 1:04pm UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956/23 "2018-02-15T13:04:54Z")

</div>

The -1 in the duration makes that it doesn’t goes back to app automatically 😉

Test it:

```
driver.runAppInBackground(Duration.ofSeconds(-1));

```

> This change is based on appium/appium-xcuitest-driver#381, which makes possible to minimize the application under test and then return to iOS springboard (emulates clicking Home button).

From [Update runAppInBackground method implementation for XCUITest by mykola-mokhnach · Pull Request #593 · appium/java-client · GitHub](https://github.com/appium/java-client/pull/593)

---

<div class="post-metadata">

**Author:** ![Shubham\_Agarwal](https://discuss.appium.io/letter_avatar_proxy/v4/letter/s/2bfe46/32.png) [@Shubham\_Agarwal](https://discuss.appium.io/u/Shubham_Agarwal)\
**Post date:** [February 15, 2018, 1:09pm UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956/24 "2018-02-15T13:09:04Z")

</div>

Great 🙂

---

<div class="post-metadata">

**Author:** ![dilipkumarj](https://discuss.appium.io/letter_avatar_proxy/v4/letter/d/aca169/32.png) [@dilipkumarj](https://discuss.appium.io/u/dilipkumarj)\
**Post date:** [February 28, 2018, 12:28pm UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956/25 "2018-02-28T12:28:09Z")

</div>

Hi After using driver.runAppInBackground(Duration.ofSeconds(-1));, how to return to the same app. Can you please help

---

<div class="post-metadata">

**Author:** ![Telmo\_Cardoso](https://discuss.appium.io/user_avatar/discuss.appium.io/telmo_cardoso/32/1435_2.png) [@Telmo\_Cardoso](https://discuss.appium.io/u/Telmo_Cardoso)\
**Post date:** [February 28, 2018, 12:42pm UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956/26 "2018-02-28T12:42:08Z")

</div>

If you are using latest Appium/Java Client use:

```
driver.activateApp(bundle_id);
```

---

<div class="post-metadata">

**Author:** ![Mahsa\_Naseri](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@Mahsa\_Naseri](https://discuss.appium.io/u/Mahsa_Naseri)\
**Post date:** [November 14, 2018, 6:50am UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956/27 "2018-11-14T06:50:20Z")

</div>

Hi how can I do the same process for Android,

driver.runAppInBackground(Duration.ofSeconds(-1));  
is working for me to go Homepage but how can I back from home to my app in android? thanks

---

<div class="post-metadata">

**Author:** ![Telmo\_Cardoso](https://discuss.appium.io/user_avatar/discuss.appium.io/telmo_cardoso/32/1435_2.png) [@Telmo\_Cardoso](https://discuss.appium.io/u/Telmo_Cardoso)\
**Post date:** [November 14, 2018, 8:52am UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956/28 "2018-11-14T08:52:51Z")

</div>

Exactly the same code as iOS, just use the android package name

---

<div class="post-metadata">

**Author:** ![Mahsa\_Naseri](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@Mahsa\_Naseri](https://discuss.appium.io/u/Mahsa_Naseri)\
**Post date:** [November 15, 2018, 2:01am UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956/29 "2018-11-15T02:01:28Z")

</div>

Thank you for your response, with app package, it launches the app from the first point which required Login, I want to just back the same page as I left the app and see the prompt message.  
Do you have any suggestion?  
but with this

> driver.activateApp ( “app package”, null );  
> driver.navigate ().back ();

it works now but I think there is another better way for it.

---

<div class="post-metadata">

**Author:** ![Kevin\_Caasi](https://discuss.appium.io/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@Kevin\_Caasi](https://discuss.appium.io/u/Kevin_Caasi)\
**Post date:** [January 22, 2019, 7:38pm UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956/30 "2019-01-22T19:38:25Z")

</div>

Reading this thread, I don’t think you got the credit you deserve for answering all these questions. Thanks, Telmo. Just curious, where there any ‘roadblocks’ you hit while accessing iOS elements [non-app specific] that you had to overcome?

---

<div class="post-metadata">

**Author:** ![sameer\_sagwan](https://discuss.appium.io/letter_avatar_proxy/v4/letter/s/ac8455/32.png) [@sameer\_sagwan](https://discuss.appium.io/u/sameer_sagwan)\
**Post date:** [February 26, 2019, 6:58am UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956/31 "2019-02-26T06:58:57Z")

</div>

Hi @Telmo_Cardoso I performed some actions on the screen and the want to go to the application’s home screen. How to do that. driver.navigate.back(); is also not working please suggest anything. I am automation my app with IOSDriver.

---

<div class="post-metadata">

**Author:** ![Surekha](https://discuss.appium.io/user_avatar/discuss.appium.io/surekha/32/6189_2.png) [@Surekha](https://discuss.appium.io/u/Surekha)\
**Post date:** [July 9, 2019, 5:59am UTC](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956/32 "2019-07-09T05:59:21Z")

</div>

Hi @Telmo_Cardoso  
I need your help. I need to automate the 3D touch iphoneX.

Can you please guide me.

ThankQ

[Previous page](https://discuss.appium.io/t/appium-ios-how-can-i-go-to-home-screen/20956.md?page=1)
