ios Safari - iPhone 模拟器调试(通过“开发”)不再显示

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21277562/
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-08-30 23:12:32  来源:igfitidea点击:

Safari - iPhone simulator debugging (via "develop") not showing anymore

iosuiwebviewios-simulator

提问by Yaniv Efraim

I am using iPhone simulator to run a UIWebview, and Safari browser (on my mac) in order to debug the js / html / css code (via "develop" menu -> iPhone Simulator -> choosing my webview).

我正在使用 iPhone 模拟器运行 UIWebview 和 Safari 浏览器(在我的 Mac 上)以调试 js/html/css 代码(通过“开发”菜单 -> iPhone 模拟器 -> 选择我的 webview)。

Yestarday, the iPhone-simulator option disappeared from my "develop" menu: (as you can see, the "iphone-simulator" is missing here (it is opened in the background and working...)

昨天,iPhone 模拟器选项从我的“开发”菜单中消失了:(如您所见,此处缺少“iphone 模拟器”(它在后台打开并工作......)

enter image description here

在此处输入图片说明

Any idea?

任何的想法?

Edit: I am using iOS 7 iPhone simulator + Safari 7

编辑:我使用的是 iOS 7 iPhone 模拟器 + Safari 7

Edit 2: Just tried opening a website on iphone-simulator's Safari browser (in addition to the UIWebview). No luck here as well...

编辑 2:刚刚尝试在 iphone-simulator 的 Safari 浏览器上打开一个网站(除了 UIWebview)。这里也没有运气...

采纳答案by Yaniv Efraim

OK, what eventually worked for me was reseting the simulator (reset content and settings) and restarting my mac...

好的,最终对我有用的是重置模拟器(重置内容和设置)并重新启动我的 mac ......

回答by Timo

I had exactly the same problem and I could not figure out how to solve it. Then I remembered that I actually have Safari Technology Preview installed on my Mac. And bang. The simulator device is visible in the Develop menu of the Technology Preview version.

我遇到了完全相同的问题,我不知道如何解决它。然后我想起我的 Mac 上实际上安装了 Safari Technology Preview。和砰。模拟器设备在技术预览版的开发菜单中可见。

回答by Radek Matěj

Sometimes it is necessary to restart Safari to make it notice new simulator, unfortunately.

不幸的是,有时需要重新启动 Safari 以使其注意到新的模拟器。

i0S 11, Safari 11

i0S 11、Safari 11

回答by Vikasdeep Singh

I also faced the same issue. Solution was, closed Safari browser and Simulator and launched again. It fixed my problem. Restarting of my Mac was not required. Hope it will save someone's time.

我也面临同样的问题。解决方案是,关闭 Safari 浏览器和模拟器并再次启动。它解决了我的问题。不需要重新启动我的 Mac。希望它会节省某人的时间。

Environment was as below:

环境如下:

  1. MacBook Pro OSX version : 10.13.2
  2. Safari browser version : 11.0.2 (13604.4.7.1.3)
  3. Simulator : iPhone 8 iOS version 11.2
  1. MacBook Pro OSX 版本:10.13.2
  2. Safari 浏览器版本:11.0.2 (13604.4.7.1.3)
  3. 模拟器:iPhone 8 iOS 11.2 版

回答by S. Bharti

If you have tried all fixes and it did not fixed your problem. Then go for below steps 1. UnInstall Xcode

如果您已经尝试了所有修复,但它没有解决您的问题。然后执行以下步骤 1. 卸载 Xcode

  1. Install Xcode again
  2. Restart you system
  3. Download Command Line tool for Xcode (same version as xcode) you can find command line tool https://developer.apple.com/download/more/here
  4. Install Command line tool
  1. 再次安装Xcode
  2. 重启你的系统
  3. 下载 Xcode 的命令行工具(与 xcode 相同的版本),您可以在此处找到命令行工具https://developer.apple.com/download/more/
  4. 安装命令行工具

These steps fixed this problem for me, Hopefully it will fix someone's else as well. Good Luck :)

这些步骤为我解决了这个问题,希望它也能解决其他人的问题。祝你好运 :)

回答by Mohit Kumar

I restarted my simulator from Hardware->Restart and after that simulator option came in Safari Develop Menu.

我从 Hardware->Restart 重新启动了我的模拟器,然后模拟器选项出现在 Safari 开发菜单中。

Hope it will save someone's time.

希望它会节省某人的时间。

回答by Timur Suleimanov

Sometimes running your app on different iOS version helps.

有时在不同的 iOS 版本上运行您的应用程序会有所帮助。