重置iOS Simulator应用程序数据以首次运行应用程序 [英] Reset iOS Simulator application data to run app for first time

查看:153
本文介绍了重置iOS Simulator应用程序数据以首次运行应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚写完一些代码,检查它是否是第一次运行该应用程序,然后显示一条消息,如果不是第一次运行,则显示另一条消息.

I just finished writing some code that checks if it is the first time the app is running then display a message, if it is not the first time then display another message..

如何在Xcode上重置模拟器,以便我可以在首次运行该应用程序时对其进行测试?

How do you reset the simulator on Xcode so that I can test the app when it runs the first time?

我尝试清理构建文件夹,但是没有用..

I tried cleaning the build folder but it didn't work..

推荐答案

在iOS模拟器中,按屏幕顶部菜单中的 iOS模拟器,然后按'重置内容和设置... ".这将清除整个模拟器.

In the iOS Simulator, press iOS Simulator in the menu at the top of the screen, and press 'Reset Content and Settings...'. This will clear the entire simulator.

或者,在模拟器的主屏幕上,以与在物理设备上相同的方式卸载应用程序,方法是按住应用程序图标,直到" x "出现在左上角,然后按一下'x',然后从警报视图中选择'删除".这将清除与单个应用程序关联的所有数据.

Or, on the home screen of the simulator, uninstall the app in the same way you would on a physical device, by pressing and holding on the application icon until an 'x' appears in the top left, and press the 'x', and select 'Delete' from the alert view. This will clear all data associated with a single app.

然后清理,构建并运行.

Then do a clean, build and run.

从Xcode 11+ Simulator开始,它位于Device>下.删除所有内容和设置

As of Xcode 11+ Simulator, this is under Device > Erase All Content and Settings

这篇关于重置iOS Simulator应用程序数据以首次运行应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆