Skip to content

Instantly share code, notes, and snippets.

@tsangint
Last active January 2, 2019 05:43
Show Gist options
  • Select an option

  • Save tsangint/d37db61a6814282353b859966b5c265d to your computer and use it in GitHub Desktop.

Select an option

Save tsangint/d37db61a6814282353b859966b5c265d to your computer and use it in GitHub Desktop.

Revisions

  1. tsangint revised this gist Jan 2, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions ios-simulator.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    #!/usr/bin/python

    # usage: ./ios-simulator.sh "iPhone XR"

    import os
    import re
    import sys
  2. tsangint created this gist Jan 2, 2019.
    19 changes: 19 additions & 0 deletions ios-simulator.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/usr/bin/python

    import os
    import re
    import sys

    name=sys.argv[1]
    print "Finding "+name

    process=os.popen("xcrun simctl list devices","r")
    processOutput=process.read()
    matched=re.search(name+'\s\(([A-z0-9\-]+)', processOutput)
    # print processOutput;
    process.close()
    if matched :
    print "UDID is "+matched.group(1)

    os.system("open -a Simulator --args -CurrentDeviceUDID "+matched.group(1))
    print "Simulator lanched"