Skip to content

Instantly share code, notes, and snippets.

@bjhomer
Created June 25, 2014 16:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjhomer/b7b3b5a105bcbe43de06 to your computer and use it in GitHub Desktop.
Save bjhomer/b7b3b5a105bcbe43de06 to your computer and use it in GitHub Desktop.
A simple python script to more easily inspect provisioning profiles.
#! /usr/bin/python
import sys
import os
def main():
if len(sys.argv) < 2:
print "Usage: profile.py <path> | <UUID>"
sys.exit()
arg = sys.argv[1]
if "." in arg:
handle_path(arg)
else:
handle_uuid(arg)
def handle_path(path):
command = "security cms -D -i '%s'" % (path)
os.system(command)
def handle_uuid(arg):
profiles_dir = os.path.expanduser("~/Library/MobileDevice/Provisioning Profiles/")
profiles = os.listdir(profiles_dir)
correct_paths = [x for x in profiles if x.startswith(arg)]
if len(correct_paths) == 0:
print "Profile with UUID [%s] not found" % arg
sys.exit()
path = correct_paths[0]
profile_path = os.path.join(profiles_dir, path)
handle_path(profile_path)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment