Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 03-25-2009, 03:50 PM   #4 (permalink)
trapper
I am evil trapper
 
Join Date: Jul 2008
Location: London
Posts: 290
Default

Ok guys I ran into this same problem last year when I was starting to develop for the iPhone. The whole lot is universal binaries (and will work fine if you use the tips above) apart from one little thing - codesign is intel only.

You can work around this with a bit of tinkering as follows...

rename /usr/bin/codesign to /usr/bin/codesign.orig

now create a new codesign file and fill with the following perl script

Code:
#!/usr/bin/perl 
#
$appDir=$ARGV[$#ARGV];
$appDir=~s/ /\\ /g;
@tmpAry=split(/\//,$appDir);
$baseAppName=$tmpAry[$#tmpAry];
$baseAppName=~s/\.app$//;
$realAppName="$appDir"."/$baseAppName";

$sign=0;
for($b=0;$b<$#ARGV;$b++) {
if($ARGV[$b] eq "-s") {
$sign=1;
}
}

$mums=`file $realAppName`;
if($sign==1 && $mums=~/executable arm/) {
#print "Signing armv6..\n"; 
$dev="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/";
$tmp="$appDir"."/tmpbin";
`$dev/lipo -create $realAppName -output $tmp`;
`mv $tmp $realAppName`;
system("/usr/bin/codesign.orig",@ARGV);
`$dev/lipo -thin armv6 $realAppName -output $tmp`;
`mv $tmp $realAppName`;
system("rm $appDir"."/CodeResources");
system("cp $appDir"."/_CodeSignature/CodeResources $appDir"."/CodeResources");
exit 0;
} else {
exec '/usr/bin/codesign.orig',@ARGV;
}
set as executable and you should now be able to run 'on device' quite happily

btw; one little trick that got me for a while

See the two lines here
Code:
system("rm $appDir"."/CodeResources");
system("cp $appDir"."/_CodeSignature/CodeResources
For some reason the iPhone won't follow the symbolic link to CodeResources so instead we need to copy the location BUT when you actually want to codesign something properly you must comment these two lines out.
ie you want to submit your app to apple for the app store!


ps; please note, I have never tried this on any SDK other than the initial 'final' release, so it might not work with any of the newer versions. Let me know if it does though, then I can upgrade too :P
__________________
Black or Red - Possibly the first ever iPhone drinking game! Try it tonight.
Kings - My second drinking game, bigger and better!

Last edited by trapper; 03-25-2009 at 03:54 PM.
trapper is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,156
Threads: 38,931
Posts: 170,811
Top Poster: smasher (2,565)
Welcome to our newest member, hoshimori
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:22 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.