Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disabling Cross-Origin Restrictions in Safari on xCode's IOS SIMULATOR (iPad)

For development purposes, I need to disable the Cross-Origin Restrictions in Safari in XCODE's IOS SIMULATOR (iPad) on my iMac.

In Safari on my iMac, this can be done simply by checking 'Disable Cross-Origin Restrictions' in Menu>Develop. how can i do the same in Safari in XCODE's IOS SIMULATOR (iPad)?

Thanks!

like image 879
dev17js Avatar asked Dec 10 '25 02:12

dev17js


1 Answers

I have tested this solution on macOS v12.6.3 and xCode Simulator v13.1. (Only tested for dev env where site is hosted at localhost)

Prerequisites,

  • Enable Develop menu on safari by Safari->Preference->Advanced and tick Show features for web developers enter image description here

You can follow below steps to disable CORS on xcode's IOS simulator,

  1. Navigate to safari on your IOS simulator.

  2. Open safari on your iMac and go to Develop menu and you should be able to see your simulator device. Navigate to that device menu and you should see a menu with list of all the open tabs on your safari browser in simulator device. In here I have only opened google.com. In case if you can't see any tabs opened, try following,

  • Navigating to Settings > Safari > Advanced and enable the Web Inspector toggle button. (This option might not be available on newer ios versions)
  • Make sure the safari browser is on foreground

enter image description here

  1. Click on any of menu items in above, in my case it's www.google.com. This will open up a new window, in which you should be able to see logs for your safari browser running in IOS simulator.

  2. In Web inspector click on the small mobile icon and then check `Disable cross-origin restrictions.enter image description here

  3. This should disable CORS for localhost sites.

like image 73
v1shva Avatar answered Dec 11 '25 15:12

v1shva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!