(后面就是代码了,我就不翻译了。)

#!/usr/bin/perl
use File::Copy; my $installPath = $ARGV[]; #the name that displays on the iPhone
my $bundleDisplayName = "New App";
# prerendered icons don't have the glossy effect applied over them.
my $prerenderedIcon = ;
# determines orientation of OS popups (text messages, volume controls)
my $landscapeOrientation = ; # these three are values defined in AppController.m
my $fpsRate = "60.0";
my $accelerometerRate = "60.0";
my $profilerOn = ""; #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", "standaloneOSXPPC", "standaloneOSXUniversal", "webplayer", "iPhone"
my $target = $ARGV[]; 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;
print ("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 = ;   
   
while(<OLDPLIST>)
{    
   if ($nextLine == )
   {
      $_ =~ s/\${PRODUCT_NAME}/$bundleDisplayName/; #swap the product name for display name
   
      $nextLine = ;
   }    if ($_ =~ m/$findLine/)
   {
      $nextLine = ;
   }
   
   ################################################################
   # 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 AppController.mm"); while(<OLDACM>)
{
   if ($_ =~ m/ENABLE_INTERNAL_PROFILER/)
   {
      $_ =~ s//$profilerOn/;
   }
   if ($_ =~ m/kFPS/)
   {
      $_ =~ s/60.0/$fpsRate/;
   }
   if ($_ =~ m/kAccelerometerFrequency/)
   {
      $_ =~ s/60.0/$accelerometerRate/;
   }
   print NEWACM $_;
} close OLDACM;
close NEWACM; `mv \'$nacmPath\' \'$oacmPath\'`;

IPhone打包工具脚本的更多相关文章

  1. InnoSetup汉化版打包工具下载-附带脚本模板

    InnoSetup汉化版打包工具下载地址: https://www.90pan.com/b1907264 脚本模板 ; 脚本用 Inno Setup 脚本向导 生成.; 查阅文档获取创建 INNO S ...

  2. 细说前端自动化打包工具--webpack

    背景 记得2004年的时候,互联网开发就是做网页,那时也没有前端和后端的区分,有时一个网站就是一些纯静态的html,通过链接组织在一起.用过Dreamweaver的都知道,做网页就像用word编辑文档 ...

  3. Pyinstaller打包Selenium脚本为exe文件执行问题

    由于同事辞职,许多运维工具的维护工作就交到我这里处理了,运维居然没人会Python脚本! 用Selenium编写的一个爬虫脚本cctv.py,需要给不懂软件的人运行.为了不让他去搭建,安装各种包,库, ...

  4. Winform打包工具SetupFactory 9 的使用

    写了个WinForm的小程序..以前没打过包..只是直接把Bin里的东西复制出来使用..自己使用是足够.但是发给别人毕竟不太好看(不牛逼)..所以就想着打包.. Vs2012自带的有打包的功能..相信 ...

  5. Inno Setup 打包工具总结

    Inno Setup 打包工具总结 分类: Install Setup 2013-02-02 15:44 2386人阅读 评论(0) 收藏 举报 最近打包用到了Inno setup,在这个过程中容易犯 ...

  6. 打包python脚本为exe可执行文件-pyinstaller和cx_freeze示例

    本文介绍使用cx_freeze和pyinstaller打包python脚本为exe文件 cx_freeze的使用实例 需要使用到的文件wxapp.py, read_file.py, setup.py ...

  7. Python打包工具setuptools的使用

    将我们写的Python程序发布成包后,可以使其能够安装使用. 在项目上测试的时候,某些情况下,可以将Python打包,然后上传到测试服务器,安装测试. setuptools是常用的打包工具. 一个简单 ...

  8. PyInstaller打包python脚本的一些心得

    PyInstaller打包python脚本的一些心得 因为在公司经常要帮同事做一个从excel表格中提取出需要的内容的重复工作,比较繁琐还容易出错:于是就想着要写个程序,但是同事又不可能在电脑上也装上 ...

  9. 前端框架VUE----webpack打包工具的使用

    在这里我仅仅的是对webpack做个讲解,webpack这个工具非常强大,解决了我们前端很繁琐的一些工具流程繁琐的事情.如果感兴趣的同学,还是看官网吧. 中文链接地址:https://www.webp ...

随机推荐

  1. 阿里云轻量级学生机搭建FTP最新教程

    碰了几次壁,我整理一下分析自己在阿里云上成功安装FTP的教程. 1.使用root用户进入云服务器. 2.rpm  -qa|grep vsftpd 查看是否安装了ftp,一般阿里云服务器你以前没安装过, ...

  2. 静态call 动态call LINK

    COBOL的调用可以是静态调用(Static Call),这时,被调用的子程序必须与调用程序一起链接(link-edited)起来形成一个完整的装载模块(Load module),但子程序依然可以单独 ...

  3. 【BZOJ 4567】【SCOI 2016】背单词

    http://www.lydsy.com/JudgeOnline/problem.php?id=4567 贪心. 任何不用第一种情况的方案吃的泡椒数都小于\(n^2\),所以最小泡椒数的方案一定不包含 ...

  4. 2017 Multi-University Training 2 解题报告

    Is Derek lying? Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)T ...

  5. Codeforces 610C:Harmony Analysis(构造)

    [题目链接] http://codeforces.com/problemset/problem/610/C [题目大意] 构造出2^n个由1和-1组成的串使得其两两点积为0 [题解] 我们可以构造这样 ...

  6. BZOJ 4883 [Lydsy2017年5月月赛]棋盘上的守卫(最小生成环套树森林)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=4883 [题目大意] 在一个n*m的棋盘上要放置若干个守卫. 对于n行来说,每行必须恰好 ...

  7. [ARC062F]Painting Graphs with AtCoDeer

    题意:一个无向图,用$k$种不同的颜色给每条边染色,问能染出多少种不同的图,如果两张图能通过循环移位环边使得颜色相同,那么这两张图被认为是相同的 数学太差伤不起啊...补了一下Burnside定理的证 ...

  8. 【最小割】【Dinic】Gym - 101128F - Landscaping

    http://blog.csdn.net/lxy767087094/article/details/68942422 #include<cstdio> #include<cstrin ...

  9. 【动态规划】 Codeforces Round #416 (Div. 2) C. Vladik and Memorable Trip

    划分那个序列,没必要完全覆盖原序列.对于划分出来的每个序列,对于某个值v,要么全都在该序列,要么全都不在该序列.  一个序列的价值是所有不同的值的异或和.整个的价值是所有划分出来的序列的价值之和.   ...

  10. B 君的第二题 (hongkong)

    B 君的第二题 (hongkong) 题目大意: 一个长度为\(n(n\le2\times10^5)\)的数组,给定一个数\(k(k\le40)\).用\(a[i][j]\)表示该数组\(i\)次前缀 ...