(I will not translate the code later .) #! /Usr/bin/perl use file: copy; my $ installpath = $ argv [0]; # The name that displays on the iPhone my $ bundledisplayname = "new app "; # prerendered icons don't have the glossy effect applied over them. my $ prerenderedicon = 1; # determines orientation of OS popups (text messages, volume controls) My $ landscapeorientation = 0; # these three are values defined in appcontroller. m my $ fpsrate = "60.0"; my $ Accelerometerrate = "60.0"; my $ profileon = "0"; # go through the info. plist file line by line until you find this one: My $ findline = "cfbundledisplayname"; my $ endofplist = "</dict> "; # copy default.png and icon.png from asset to installpath my $ iconfilename = "icon.png"; my $ defaultfilename = "default.png"; # The type of player built: # "dashboard ", "standalonewin32", "standaloneosxintel", "St Andaloneosxppc "," standaloneosxuniversal "," webplayer "," iPhone "my $ target = $ argv [1]; print ("\ n *** postprocessbuildplayer-building at '$ installpath' with target: $ target *** \ n"); my $ DST = $ installpath. "/". $ iconfilename; print ("copying icon.png [$ iconfilename-> $ DST] \ n"); copy ($ iconfilename, $ DST) or die "icon file can not be copied "; my $ DST = $ installpath. "/". $ defaultfilename; PR INT ("copying default.png [$ defaultfilename-> $ DST] \ n"); copy ($ defaultfilename, $ DST) or die "default file can not be copied "; ######################################## ######################### This modifies info. plist so you don't have to ## set bundledisplayname manually ########################### ####################################### open this file $ oplistpath = $ installpath. "/info. plist"; $ Nplistpath = $ installpath. "/info. plist. TMP "; open oldplist," <", $ oplistpath or die (" cannot open info. plist "); open newplist,"> ", $ nplistpath or die (" cannot create new info. plist "); my $ nextline = 0; while (<oldplist>) {if ($ nextline = 1) {$ _ = ~ S/\ $ {product_name}/$ bundledisplayname/; # swap the product name for display name $ nextline = 0;} if ($ _ = ~ M/$ findline/) {$ nextline = 1 ;} ######################################## ######################## add any key/value pairs you want at the end of info. plist ####################################### ########################## if ($ _ = ~ M/$ endofplist/) {my $ keys = ""; if ($ prerenderedicon) {$ keys. = "<key> uiprerenderedicon </key> \ n"; $ keys. = "<true/> \ n";} if ($ landscapeorientation) {$ keys. = "<key> uiinterfaceorientation </key> \ n"; $ keys. = "<string> uiinterfaceorientationlandscaperight </string> \ n" ;}$ _ = $ keys. $ _;} print newplist $ _;} Close oldplist; close newplist; 'mv \ '$ nplistpath \' $ oplistpath \''; ############### ######################################## ######### Change default profiler & kfps rates ######################## ######################################## # $ oacmpath = $ installpath. "/classes/appcontroller. MM "; $ nacmpath = $ installpath. "/classes/appcontroller. mm. TMP "; open oldacm," <", $ oacmpath or die (" cannot open appcontroller. MM "); open newacm,"> ", $ nacmpath or die (" cannot create new appcontrol Ler. MM "); While (<oldacm>) {if ($ _ = ~ M/enable_internal_profiler/) {$ _ = ~ S/0/$ profileon/;} if ($ _ = ~ M/kfps/) {$ _ = ~ S/60.0/$ fpsrate/;} if ($ _ = ~ M/kaccelerometerfrequency/) {$ _ = ~ S/60.0/$ accelerometerrate/;} print newacm $ _;} Close oldacm; close newacm; 'mv \ '$ nacmpath \' $ oacmpath \'';
IPhone packaging tool script