Skip to content

Instantly share code, notes, and snippets.

@bgrins
Last active January 20, 2023 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgrins/bbc575da9ecfea9469de0774b2451418 to your computer and use it in GitHub Desktop.
Save bgrins/bbc575da9ecfea9469de0774b2451418 to your computer and use it in GitHub Desktop.
Open URL in current iOS simulator

First open a simulator:

open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app

Then open a given URL in mobile Safari:

/Applications/Xcode.app/Contents/Developer/usr/bin/simctl openurl `/Applications/Xcode.app/Contents/Developer/usr/bin/simctl list | grep Booted | perl -ne'/\(([A-Z,0-9,-]+)\)/ && print "$1"'` "http://localhost:3000"

First start the server on 5173, then start the browser sync server on 3000:

npx browser-sync start --no-open --proxy "http://localhost:5173" 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment