Skip to content

Instantly share code, notes, and snippets.

@lihei12345
Created February 24, 2016 07:54
Show Gist options
  • Save lihei12345/31e91e747d16aa2d304f to your computer and use it in GitHub Desktop.
Save lihei12345/31e91e747d16aa2d304f to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import os
path = os.path.expanduser('~') + '/Library/MobileDevice/Provisioning Profiles'
cmd_path = os.path.expanduser('~') + '/Library/MobileDevice/Provisioning\ Profiles'
provision_files = [x for x in os.listdir(path) if os.path.splitext(x)[1]==".mobileprovision"]
output_path = os.path.expanduser('~') + '/Desktop/provision_infos'
if not os.path.exists(output_path):
os.mkdir(output_path)
for provision in provision_files:
file_name = os.path.basename(provision)
cmd = 'security cms -D -i ' + cmd_path + '/' + provision + ' > ' + output_path + '/' + file_name + '.plist'
os.system(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment