Question

I am currently developing an app in Xamarin Studio, where I would like to modify the build info.plist via a script. Xamarin Studio unfortunately lacks a script build phase however, so my only option is really to run a script after the build, which of course breaks the signing.

Since different identities are used for different configurations I cannot make the identity static, and either way I'd really like to interfere with Xamarin as little as possible (I.E. be able to use the project settings etc).

Is there a way to resign the app using the identity it is currently signed with, via a shell script?

Was it helpful?

Solution 3

So I found a solution:

#!/usr/bin/env python

import sys
import subprocess
import re
import os

app_path = os.path.abspath(sys.argv[1])

signing_info = subprocess.Popen(['codesign', '--display', '--verbose=4', app_path], stdin=subprocess.PIPE, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, close_fds=True).communicate()[0]

identity = re.search('Authority=(.*)', signing_info).group(1)

subprocess.call(['codesign', '--sign', identity, '--force', '--preserve-metadata=entitlements,resource-rules,requirements', '/Users/stefanfisk/Projekt/Tunaspot/Xamarin/App/Touch/bin/iPhone/Ad-Hoc/Touch.app'])

OTHER TIPS

You can try to modify Info.plist and after that resign your application bundle again. I have never tried to do so, but I believe, it should work.

have you tried xcodebuild command, Identity is specified in the build configuration so you just need to mention the configuration.. you can find xcodeproj in /obj/xcode/somewhere

xcodebuild -project Xamarin.xcodeproj  -scheme TestApp -configuration "Ad Hoc"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top