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 04-04-2009, 02:39 PM   #9 (permalink)
pmvinuelas
Registered Member
 
Join Date: Feb 2009
Posts: 87
Default

Quote:
Originally Posted by trapper View Post
I develop, test on device, and even submit apps to the store all on my G4.

The codesign script is the key.
Quote:
Originally Posted by trapper View Post
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
Trapper: I am new to macs but i have succesfully created and tested my app on the simulator you say to "rename /usr/bin/codesign to /usr/bin/codesign.orig"

How do i do this. Where do i find it? Can you explain this part to me alittle more so i can actually get my app out there?

Your a badass for helping me!

Thanks
pmvinuelas is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,322
Threads: 39,120
Posts: 171,521
Top Poster: smasher (2,577)
Welcome to our newest member, freney
Powered by vBadvanced CMPS v3.1.0

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