- Home /
How to simulate [iOS] app suspend on the Unity editor?
I need to simulate the iPhone/iPad hard button press on the Unity editor so that I don't have to build to test my code. Is this possible in Unity? If not, can you please suggest a workaround? Thanks.
The button on the iOS device which you press to get to the homescreen. I actually answered this question already, but the moderators are taking their time. :/
Anyway, you can do this by simply changing windows (i.e. alt-tabbing on Windows). Losing the focus from the Unity editor simulates a pause or app suspend, returning the focus to the editor creates a resume. I hope this helps! :D
Answer by brain56 · Jul 05, 2012 at 11:36 AM
I've accidentally found the answer. Simply change windows or at least lose your focus from the Unity editor. Use Alt+Tab if you're on Windows, and that's about it. Resuming means regaining your focus on the Window, so Alt+Tab again.
Answer by chilemanga · Oct 08, 2015 at 08:50 PM
This works for me, but just for OnApplicationFocus, not OnApplicationPause.
OnApplicationPause works for me in Unity 5.3. Tabbing away fires with pauseStatus = true, and tabbing back calls with pauseStatus = false.
Your answer
Follow this Question
Related Questions
How can i make button on iOS instead key 0 Answers
Map iOS joystick to the input manager? 2 Answers
A node in a childnode? 1 Answer
how to detect if my game is running on iphone or in Unity? 1 Answer
Mecanim for Mobile Devices 2 Answers