iOS App Installation Package Slimming Guide

Abstract: The brainless execution process of the installation package slimming is listed below, in which the "Wonderful Skills" part is the optimization of resources for selected questions to delete useless pictures Use LSUnusedResources to find useless pictures and delete duplicate resources Compress picture resources Use ImageOptim to compress pictures with lossless use TinyPNG The lossy compressed image TinyPNG is very easy to use. It is highly recommended to directly execute tinypng *.

The following lists the brainless execution process of the installation package slimming, of which the "Fantastic Skills" part is optional.
Resource optimization
Delete useless images
Use LSUnusedResources Find useless images,
delete duplicate resources,
compress image resources,
use ImageOptim to compress images losslessly, and use
TinyPNG to compress images losslessly
Startup pictures Local large pictures are loaded on demand using webp resources, and non-essential resources are pulled from the server when they are used. Compile options optimization Optimization Level is set to Fastest in the release state, Smallest Strip Debug Symbols During Copy is set to YES in the release state Strip Linked Product is set to YES in release status









Make String Read-Only is set to YES in release state
Dead Code Stripping is set to YES in release state
Deployment PostProcessing is set to YES in release state
Symbols hidden by default is set to YES in release state
Executable file optimization
Using LinkMap to analyze library usage
Three parties Library optimization
Delete unused third-party libraries Third-party libraries
with few functions but large size can be rewritten by yourself
Merge third-party libraries with duplicate functions
Code analysis
Use AppCode for code scanning
Remove useless classes and files
Clean up imports
to remove empty methods
Remove useless ones log to remove useless
variables,
anyway , remove everything that can be removed . Rewrite part of the native interface with Weex to remove the Swift code. The Swift standard library is packaged in the installation package, generally 10M+. Then Apple's dad said that when the Swift Runtime is stable, it will be merged into the iOS system, and then using Swift will not significantly increase the package size.




Add the following command in target->Build Settings->Other Link Flags, which will transfer part of the content of the TEXT field to the RODATA field to avoid Apple's review restrictions on the TEXT field. Of course, in fact, it doesn't seem to have anything to do with the installation package slimming, so unless it is dying, it is not recommended to operate =. = -Wl,-rename_section,__TEXT,__cstring,__RODATA,__cstring -Wl,-rename_section,__TEXT,__gcc_except_tab,__RODATA,__gcc_except_tab -Wl,-rename_section,__TEXT,__const,__RODATA,__const -Wl,-rename_section,__TEXT,__objc_methname, __RODATA,__objc_methname -Wl,-rename_section,__TEXT,__objc_classname,__RODATA,__objc_classname -Wl,-rename_section,__TEXT,__objc_methtype,__RODATA,__objc_methtype
Follow Apple Dad
App
Thinning Use xcasset to manage pictures
Open
BitCode No reprint is allowed with permission. If you want to reprint, please send an email to [email protected]; if you find any content suspected of plagiarism in this community, please send an email to: [email protected] to report, and Provide relevant evidence. Once verified, this community will immediately delete the allegedly infringing content.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326120723&siteId=291194637
Recommended