Safari - iPhone simulator debugging (via “develop”

2020-05-22 15:20发布

问题:

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).

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...)

Any idea?

Edit: I am using iOS 7 iPhone simulator + 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...

回答1:

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.



回答2:

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

i0S 11, Safari 11



回答3:

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



回答4:

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.

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


回答5:

Sometimes running your app on different iOS version helps.



回答6:

If you have tried all fixes and it did not fixed your problem. Then go for below steps 1. UnInstall 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

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



回答7:

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

Hope it will save someone's time.