Finding unused files in Xcode

前端 未结 6 926
生来不讨喜
生来不讨喜 2021-02-18 18:52

I\'ve recently started work on a new app which is basically a copy of a previous app I made, with a few changes. To make this new app I\'ve copied the old app and removed some s

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-18 19:25

    Also see this shell scripts http://mfaizanshaikh.wordpress.com/2012/12/17/how-to-remove-unused-images-from-xcode-project/

    Basically the shell script below, finds all the png files in your project that are not used in any of the xib files. Of course if you have used the png file in other ways (storyboards, load in the code), this script will still show them as unused.
    for reference I paste the scripts here as well:

    #!/bin/sh
    PROJ=`find . -name '*.xib' -o -name '*.[mh]'`
    
    for png in `find . -name '*.png'`
    do
        name=`basename $png`
        if ! grep -q $name $PROJ; then
            echo "$png is not referenced"
        fi
    done
    

提交回复
热议问题