IPhone packaging tool script

Source: Internet
Author: User
(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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.