xcode ios模拟器:如何关闭应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18519799/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:53:49  来源:igfitidea点击:

ios simulator: how to close an app

xcodeios7ios6ios-simulatorsimulator

提问by Chicowitz

When you "run" the simulator from xCode, the app automatically launches, and then you can click the home button to suspend the app. What I want to do is closethe app from within the simulator. So, how can this be done?

当您从 xCode“运行”模拟器时,应用程序会自动启动,然后您可以单击主页按钮暂停应用程序。我想要做的是从模拟器内关闭应用程序。那么,如何做到这一点呢?

回答by lehn0058

You can also do it with the keyboard shortcut shown under the simulator menu bar (Hardware-> Home).

您也可以使用模拟器菜单栏(硬件-> 主页)下显示的键盘快捷键来完成。

The shortcut is ?+?+H, but you need to hit Htwice in a row for it to simulate the double press that shows the apps.

快捷方式是 ?+ ?+ H,但您需要H连续点击两次才能模拟显示应用程序的双击。

回答by Chicowitz

For iOS 7 & above:

对于 iOS 7 及以上:

  • shift+command+H twiceto simulate the double tap of home button
  • swipe your app's screenshot upward to close it
  • shift+command+H两次模拟home键双击
  • 向上滑动您应用的屏幕截图以关闭它

You'll see screenshots representing the apps suspended on your device - those screenshots respond to touch events. Swiping is the gesture you'll make to "fling" the screenshot off of the screen. Note that on machines where your mouse is intended to represent your finger, you'll click and swipe as if it is your finger tapping and making the gesture.

您将看到代表设备上暂停的应用程序的屏幕截图 - 这些屏幕截图响应触摸事件。滑动是您将屏幕截图“甩”出屏幕的手势。请注意,在您的鼠标旨在代表您的手指的机器上,您将点击和滑动,就像您的手指点击并做出手势一样。

回答by Ray Hunter

On the new iPhone X, the simulator was having issues with the mouse/finger gesture.

在新的 iPhone X 上,模拟器在鼠标/手指手势方面存在问题。

You can do a long press with the mouse and a close icon will appear. You can use the swipe up gesture as well to close the app.

您可以用鼠标长按,然后会出现一个关闭图标。您也可以使用向上滑动手势关闭应用程序。

close app on simulator

在模拟器上关闭应用程序

回答by matt

Window / Show Device Bezels

窗口/显示设备边框

And now you can see the real device, so double tap on HOME button and kill you app

现在你可以看到真实的设备,所以双击 HOME 按钮并杀死你的应用程序

回答by Archit Kapoor

I had a difficult time in finding a way in XCode 7.2, but finally I had found one. First press Shift+Command+ H twice. This will open up all the apps that are currently open.

我很难在 XCode 7.2 中找到方法,但最终我找到了方法。首先按 Shift+Command+ H 两次。这将打开当前打开的所有应用程序。

Swipe left/right to the app you actually want to close. Just Swipe Up using the Touchpad while Holding the Appwould close the app.

向左/向右滑动到您实际想要关闭的应用程序。只需在按住应用程序的同时使用触摸板向上滑动即可关闭应用程序。

回答by Tulon

For closing (not quit) the running application in Simulator the keyboard shortcut is "shift+command+h".

要关闭(不退出)模拟器中正在运行的应用程序,键盘快捷键是“shift+command+h”。

回答by Tony

Double click on the home button and then click and hold the icon like a normal phone and then click close I believe.

双击主页按钮,然后像普通电话一样单击并按住图标,然后单击关闭我相信。

回答by Rishabh Arya

You can use this command to quit an app in iOS Simulator

您可以使用此命令退出 iOS 模拟器中的应用程序

xcrun simctl terminate booted com.apple.mobilesafari

You will need to know the bundle id of the app you have installed in the simulator. You can refer to this link

您需要知道已安装在模拟器中的应用程序的包 ID。你可以参考这个链接

回答by Keshav Gera

Command + shift +h Press H 2 times

Command + shift +h 按 H 2 次

Note :- Press H 2 times

注意:-按 H 2 次