Last active
January 2, 2019 05:43
-
-
Save tsangint/d37db61a6814282353b859966b5c265d to your computer and use it in GitHub Desktop.
iOS simulator shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# usage: ./ios-simulator.sh "iPhone XR" | |
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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment