1, LSUnusedResources remove redundant images

Download the LSUnusedResources project at the following address. Run the project, select the project path to scan, find the redundant image resources in the project. Note here that the Ignore similar Name option needs to be checked before scanning.

2, ImageOptim image lossless compression

Use the ImageOptim tool for lossless compression of images

3. It is recommended to download large resources such as audio and video to the local computer after the project installation and login. Or the larger files in the project, such as HTML, DB, audio and video, etc., are compressed and stored locally after the project is decompressed. You can useSSZipArchiveDecompress.

SameCoderFinder removes the same code

Download the SameCodeFinder script at the following address

Check whether Python is installed locally by using commands

View the Python 2 version
python --version
Copy the code
View the Python 3 version
python3 --version
Copy the code
View the PIP version and location (PIP or pip3 depending on the system and Python version)
pip --version
Copy the code

If python and PIP are not installed, you can use the following command to install Python

Install python3
brew install python3
Copy the code
Downloading the Installation script
curl https://bootstrap.pypa.io/get-pip.py
Copy the code
Install the PIP
python3 get-pip.py
Copy the code

After the installation is complete, use the following methods to install SimHash

pip install simhash
Copy the code

Finally, go to the directory where samecodefinder.py is stored and execute the following command

python SameCodeFinder.py ~/Projects/opensource/MWPhotoBrowser/ .m  --max-distance=10 --min-linecount=3 --functions --detail
Copy the code

Note: the ~ / Projects/opensource/MWPhotoBrowser/need to be replaced for the local path of the project. The analysis result is output as out.txt in samecodefinder. py. The last digit represents the Hamming distance between the two files. The smaller the number, the more similar the two files are, as follows:

5, AppCode

Use AppCode to detect unused classes and methods in the project. Download AppCode, password :d87i

6. Compiler dependent

In buildSetting, Strip Linked Product, Deployment Postprocessing, Symbols Hidden by Default should be set to yes in release. You can remove unnecessary debug symbols. It is important to note that setting Deployment Postprocessing to YES in the Debug case will cause the Debug Debug to fail to stop at the breakpoint.

7. Use Python script to scan mach-o files

In Mach-o, __TEXT:__objc_methname: holds all methods, while __DATA__objc_selrefs contains all used methods, and all unused methods can be obtained by taking the difference between the two sets. See objc_Cover for a script implementation