Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 03-25-2009, 04:50 PM   #4 (permalink)
trapper
I am evil trapper
 
Join Date: Jul 2008
Location: London
Posts: 299
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 04:54 PM.
trapper is offline   Reply With Quote
 

» Advertisements
» Online Users: 698
21 members and 677 guests
ADY, Anahtarcı, dacapo, dapis, denied, fanarin, Fit4him, ilmman, jimbo, joeallenpro, LiquidFire, mathieuh, padsoftware, Punkjumper, ric2z, robotkid249, Sander, thesooty, Thompson22, troop231, tymex
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,558
Threads: 89,128
Posts: 380,257
Top Poster: BrianSlick (7,103)
Welcome to our newest member, thesooty
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:33 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.