Allow different identities for iOS code signing
Docs-Preview: https://skia.org/?cl=81340
Bug: skia:
Change-Id: I9a0e52ba4ce3c0c4b40cc65ce6b26bd3cebdbe4d
Reviewed-on: https://skia-review.googlesource.com/81340
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
diff --git a/gn/codesign_ios.py b/gn/codesign_ios.py
index 66a97d3..beb3603 100644
--- a/gn/codesign_ios.py
+++ b/gn/codesign_ios.py
@@ -16,12 +16,14 @@
# Arguments to the script:
# pkg path to application directory, e.g. out/Debug/dm.app
# executable and plist should already be in this directory
-pkg, = sys.argv[1:]
+# identstr search string (regex fragment) for code signing identity
+# profile name of provisioning profile
+pkg,identstr,profile = sys.argv[1:]
# Find the Google signing identity.
identity = None
for line in subprocess.check_output(['security', 'find-identity']).split('\n'):
- m = re.match(r'''.*\) (.*) ".*Google.*"''', line)
+ m = re.match(r'''.*\) (.*) "''' + identstr + '"', line)
if m:
identity = m.group(1)
assert identity
@@ -31,7 +33,7 @@
for p in glob.glob(os.path.join(os.environ['HOME'], 'Library', 'MobileDevice',
'Provisioning Profiles', '*.mobileprovision')):
if re.search(r'''<key>Name</key>
-\t<string>Google Development</string>''', open(p).read(), re.MULTILINE):
+\t<string>''' + profile + r'''</string>''', open(p).read(), re.MULTILINE):
mobileprovision = p
assert mobileprovision