简体   繁体   English

如何清除IOS模拟器内存​​缓存

[英]How to clear IOS simulator memory cache

In my ionic app I set tokens in local memory: 在我的离子应用程序中,我在本地内存中设置了令牌:

 set: function(key, value) {
        $window.localStorage[key] = value;
      },

This works fine. 这很好用。 When i ran the app in ios simulator for the first time.. it detected that there was nothing in the localstorage and behaved accordigly. 当我第一次在ios模拟器中运行应用程序时...它检测到本地存储中没有任何内容并且表现得恰到好处。 However everytime I run the app in the simulator now.. it always detects the token . 但是,每次我在模拟器中运行应用程序时,它总是检测到令牌。 I would like to clear the localStorage in the IOS simulator for my app. 我想清除我的应用程序的IOS模拟器中的localStorage。

Whats the process to do this ? 这个过程是怎么回事?

Just treat your simulator like a real iPhone. 只需将您的模拟器视为真正的iPhone。 Click and hold one of the icons so they all wiggle. 单击并按住其中一个图标,使它们全部摆动。 Then delete your installed app. 然后删除已安装的应用。 This will remove its saved data. 这将删除其保存的数据。

Hit - H (like the home button on the phone) to exit wiggle mode. - H (如手机上的主屏幕按钮)退出摆动模式。

Open the simulator. 打开模拟器。 Open the iOS Simulator, in the top Menu bar: Hardware -> Erase All Content and Settings... . 在顶部菜单栏中打开iOS模拟器: Hardware -> Erase All Content and Settings... This will clear the whole simulator to default settings as well as remove any apps you have installed and their associated stored data. 这将清除整个模拟器的默认设置,以及删除已安装的任何应用程序及其关联的存储数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM