0

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?

Wain
  • 118,658
  • 15
  • 128
  • 151
Stefan Fisk
  • 1,563
  • 13
  • 19

3 Answers3

0

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.

Vytautas
  • 573
  • 3
  • 8
0

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"
yasirmturk
  • 1,924
  • 2
  • 22
  • 32
  • I have this all working properly in several Xcode projects, but that's only because the script build phase makes it trivial to implement. – Stefan Fisk Jan 24 '14 at 09:44
  • how would that work? there is not xcodeproj, only Visual Studio solution and project files. – Stefan Fisk Jan 24 '14 at 10:11
  • in there I can only find the temporary Xcode projects used when editing xibs. during build nothing xcode related is created in the obj folder, and when looking at the build output I cannot see xcodebuild being called anywhere, only mtouch. – Stefan Fisk Jan 24 '14 at 12:31
0

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'])
Mike Mertsock
  • 11,825
  • 7
  • 42
  • 75
Stefan Fisk
  • 1,563
  • 13
  • 19