Created
June 25, 2014 16:39
-
-
Save bjhomer/b7b3b5a105bcbe43de06 to your computer and use it in GitHub Desktop.
A simple python script to more easily inspect provisioning profiles.
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 | |
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