如何删除xcode项目中不再使用的图片资源

来源:互联网 发布:怎么做淘宝店铺模板 编辑:程序博客网 时间:2024/05/21 11:22

由于随着项目不但的版本迭代开发,资源也不断的替换,如果没有养成一个好的使用习惯,时间久了,自然就产生了好多的无用的图片资源,下面就两种方法帮你定位到无用的图片


1. 利用工具    下载地址  http://jeffhodnett.github.io/Unused/   运行效果如下

 


2. 通过终端 执行 shell 命令

a. 第一步建立.sh 文件  如 unusedImage.sh

         

[plain] view plaincopy在CODE上查看代码片派生到我的代码片
  1. #!/bin/sh  
  2. PROJ=`find . -name '*.xib' -o -name '*.[mh]'`  
  3.   
  4. for png in `find . -name '*.png'`  
  5. do  
  6.     name=`basename $png`  
  7.     if ! grep -qhs "$name" "$PROJ"; then  
  8.         echo "$png is not referenced"  
  9.     fi  
  10. done  


b. 进入你要查找的工程目录下执行 这段 shell 脚本

[plain] view plaincopy在CODE上查看代码片派生到我的代码片
  1. sh unusedImage.sh   

运行结果如下




0 0
原创粉丝点击