How can I simulate app being killed in background?

后端 未结 4 1100
小蘑菇
小蘑菇 2021-02-05 01:21

I\'m trying to verify that my app (App1) behaves correctly when it is shut down by the system after it launches another app (App2). Is there any way to simulate or force this be

4条回答
  •  面向向阳花
    2021-02-05 01:49

    I know this is a couple of years old, but wanted to share if anyone else is looking into this now. Try the following steps:

    1. Run the app on a device
    2. Press the home button once to go to the home screen
    3. Press and hold the power button for 5 seconds until you see the power off slider
    4. Press and hold the home button for 5 seconds

    If you were running the app from Xcode you should see Message from debugger: Terminated due to signal 9

提交回复
热议问题