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

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

 

 

2. 通过终端 执行 shell 命令

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

         

[plain] view plain copy
 
 在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 plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. sh unusedImage.sh   

 

 

运行结果如下

 

posted @ 2016-09-27 11:42  FakeCoder  阅读(701)  评论(0编辑  收藏  举报