<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>资源收集网页</title><link>http://x.zx.cdqlx.top/</link><description>IM合集</description><item><title>Linux下安装mysql8.0</title><link>http://x.zx.cdqlx.top/?id=33</link><description>&lt;h2&gt;一、下载mysql8.0安装包&lt;/h2&gt;&lt;h3&gt;1、在local创建mysql文件夹&lt;/h3&gt;&lt;pre class=&quot;line-numbers  language-bash&quot; style=&quot;box-sizing: border-box; font-size: 12px; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; margin-top: 0px; margin-bottom: 20px; overflow: scroll auto; overflow-wrap: normal; word-break: break-all; overscroll-behavior-x: contain; border-radius: 4px; z-index: 0; padding: 1em 1em 1em 3.8em; line-height: 1.5; color: rgb(204, 204, 204); background-color: rgb(45, 45, 45); tab-size: 4; hyphens: none; position: relative; counter-reset: linenumber 0;&quot;&gt;cd&amp;nbsp;/usr/local

mkdir&amp;nbsp;mysql

cd&amp;nbsp;mysql&lt;/pre&gt;&lt;h3&gt;2、使用wget下载mysql8.0的xz安装包&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;wget &lt;a href=&quot;https://links.jianshu.com/go?to=https%3A%2F%2Fdev.mysql.com%2Fget%2FDownloads%2FMySQL-8.0%2Fmysql-8.0.20-linux-glibc2.12-x86_64.tar.xz&quot; target=&quot;_blank&quot;&gt;https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2&gt;二、解压mysql8.0安装包&lt;/h2&gt;&lt;h3&gt;1、解压&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;tar -xvJf mysql-8.0.21-linux-glibc2.12-x86_64.tar.xz&lt;/p&gt;&lt;/blockquote&gt;&lt;h3&gt;2、重命名解压后的mysql文件夹（名字太长了）&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;mv mysql-8.0.21-linux-glibc2.12-x86_64 mysql8.0&lt;/p&gt;&lt;/blockquote&gt;&lt;h3&gt;3、创建data存储文件&lt;/h3&gt;&lt;pre class=&quot;line-numbers  language-bash&quot; style=&quot;box-sizing: border-box; font-size: 12px; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; margin-top: 0px; margin-bottom: 20px; overflow: scroll auto; overflow-wrap: normal; word-break: break-all; overscroll-behavior-x: contain; border-radius: 4px; z-index: 0; padding: 1em 1em 1em 3.8em; line-height: 1.5; color: rgb(204, 204, 204); background-color: rgb(45, 45, 45); tab-size: 4; hyphens: none; position: relative; counter-reset: linenumber 0;&quot;&gt;cd&amp;nbsp;mysql8.0

mkdir&amp;nbsp;data&lt;/pre&gt;&lt;h2&gt;三、创建用户和用户组，并赋予权限&lt;/h2&gt;&lt;h3&gt;1、创建用户和用户组&lt;/h3&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-undefined&quot;&gt;groupadd&amp;nbsp;mysql
&amp;nbsp;
useradd&amp;nbsp;-g&amp;nbsp;mysql&amp;nbsp;mysql&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;2、给用户赋予权限&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;chown -R mysql.mysql /usr/local/mysql/mysql8.0&lt;/p&gt;&lt;/blockquote&gt;&lt;h2&gt;四、初始化mysql信息&lt;/h2&gt;&lt;h3&gt;1、切换到mysql8.0安装路径下&lt;/h3&gt;&lt;p&gt;Tip：绝对路径：cd /usr/local/mysql/mysql8.0/bin&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;cd bin&lt;/p&gt;&lt;/blockquote&gt;&lt;h3&gt;2、初始化mysql基本信息&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;./mysqld --user=mysql --basedir=/usr/local/mysql/mysql8.0 --datadir=/usr/local/mysql/mysql8.0/data/ --initialize&lt;/p&gt;&lt;/blockquote&gt;&lt;h3&gt;3、获取到临时mysql密码&lt;/h3&gt;&lt;div class=&quot;image-package&quot;&gt;&lt;div class=&quot;image-container&quot; style=&quot;max-width: 700px; max-height: 271px;&quot;&gt;&lt;div class=&quot;image-view&quot; data-width=&quot;1606&quot; data-height=&quot;271&quot;&gt;&lt;img data-original-src=&quot;//upload-images.jianshu.io/upload_images/27055388-70000df6316ef37f.png&quot; data-original-width=&quot;1606&quot; data-original-height=&quot;271&quot; data-original-format=&quot;image/png&quot; data-original-filesize=&quot;47070&quot; data-image-index=&quot;0&quot; style=&quot;cursor: zoom-in;&quot; class=&quot;&quot; src=&quot;//upload-images.jianshu.io/upload_images/27055388-70000df6316ef37f.png?imageMogr2/auto-orient/strip|imageView2/2/w/1200/format/webp&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;image-caption&quot;&gt;file&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;五、添加mysqld服务到系统&lt;/h2&gt;&lt;h3&gt;1、将mysqld服务添加到系统中&lt;/h3&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-bash&quot;&gt;cd&amp;nbsp;/usr/local/mysql/mysql8.0

cp&amp;nbsp;-a&amp;nbsp;./support-files/mysql.server&amp;nbsp;/etc/init.d/mysql&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;2、授权以及添加服务&lt;/h3&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-csharp&quot;&gt;chmod&amp;nbsp;+x&amp;nbsp;/etc/init.d/mysql

chkconfig&amp;nbsp;--add&amp;nbsp;mysql&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;3、mysql5.7以后就没有my.cnf了，所以我们创建一个。（个人觉得方便一些）&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;sudo vim my.cnf&lt;/p&gt;&lt;/blockquote&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-ruby&quot;&gt;&lt;br/&gt;&lt;/pre&gt;&lt;pre class=&quot;line-numbers  language-ruby&quot; style=&quot;box-sizing: border-box; font-size: 12px; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; margin-top: 0px; margin-bottom: 20px; overflow: scroll auto; overflow-wrap: normal; word-break: break-all; overscroll-behavior-x: contain; border-radius: 4px; z-index: 0; padding: 1em 1em 1em 3.8em; line-height: 1.5; color: rgb(204, 204, 204); background-color: rgb(45, 45, 45); tab-size: 4; hyphens: none; position: relative; counter-reset: linenumber 0;&quot;&gt;#&amp;nbsp;Example&amp;nbsp;MySQL&amp;nbsp;config&amp;nbsp;file&amp;nbsp;for&amp;nbsp;small&amp;nbsp;systems.&amp;nbsp;&amp;nbsp;#&amp;nbsp;&amp;nbsp;#&amp;nbsp;This&amp;nbsp;is&amp;nbsp;for&amp;nbsp;a&amp;nbsp;system&amp;nbsp;with&amp;nbsp;little&amp;nbsp;memory&amp;nbsp;(&amp;lt;=&amp;nbsp;64M)&amp;nbsp;where&amp;nbsp;MySQL&amp;nbsp;is&amp;nbsp;only&amp;nbsp;used&amp;nbsp;&amp;nbsp;#&amp;nbsp;from&amp;nbsp;time&amp;nbsp;to&amp;nbsp;time&amp;nbsp;and&amp;nbsp;it&amp;#39;s&amp;nbsp;important&amp;nbsp;that&amp;nbsp;the&amp;nbsp;mysqld&amp;nbsp;daemon&amp;nbsp;&amp;nbsp;#&amp;nbsp;doesn&amp;#39;t&amp;nbsp;use&amp;nbsp;much&amp;nbsp;resources.&amp;nbsp;&amp;nbsp;#&amp;nbsp;&amp;nbsp;#&amp;nbsp;MySQL&amp;nbsp;programs&amp;nbsp;look&amp;nbsp;for&amp;nbsp;option&amp;nbsp;files&amp;nbsp;in&amp;nbsp;a&amp;nbsp;set&amp;nbsp;of&amp;nbsp;&amp;nbsp;#&amp;nbsp;locations&amp;nbsp;which&amp;nbsp;depend&amp;nbsp;on&amp;nbsp;the&amp;nbsp;deployment&amp;nbsp;platform.&amp;nbsp;&amp;nbsp;#&amp;nbsp;You&amp;nbsp;can&amp;nbsp;copy&amp;nbsp;this&amp;nbsp;option&amp;nbsp;file&amp;nbsp;to&amp;nbsp;one&amp;nbsp;of&amp;nbsp;those&amp;nbsp;&amp;nbsp;#&amp;nbsp;locations.&amp;nbsp;For&amp;nbsp;information&amp;nbsp;about&amp;nbsp;these&amp;nbsp;locations,&amp;nbsp;see:&amp;nbsp;&amp;nbsp;#&amp;nbsp;http://dev.mysql.com/doc/mysql/en/option-files.html&amp;nbsp;&amp;nbsp;#&amp;nbsp;&amp;nbsp;#&amp;nbsp;In&amp;nbsp;this&amp;nbsp;file,&amp;nbsp;you&amp;nbsp;can&amp;nbsp;use&amp;nbsp;all&amp;nbsp;long&amp;nbsp;options&amp;nbsp;that&amp;nbsp;a&amp;nbsp;program&amp;nbsp;supports.&amp;nbsp;&amp;nbsp;#&amp;nbsp;If&amp;nbsp;you&amp;nbsp;want&amp;nbsp;to&amp;nbsp;know&amp;nbsp;which&amp;nbsp;options&amp;nbsp;a&amp;nbsp;program&amp;nbsp;supports,&amp;nbsp;run&amp;nbsp;the&amp;nbsp;program&amp;nbsp;&amp;nbsp;#&amp;nbsp;with&amp;nbsp;the&amp;nbsp;&amp;quot;--help&amp;quot;&amp;nbsp;option.&amp;nbsp;&amp;nbsp;
&amp;nbsp;#&amp;nbsp;The&amp;nbsp;following&amp;nbsp;options&amp;nbsp;will&amp;nbsp;be&amp;nbsp;passed&amp;nbsp;to&amp;nbsp;all&amp;nbsp;MySQL&amp;nbsp;clients&amp;nbsp;&amp;nbsp;[client]&amp;nbsp;&amp;nbsp;default-character-set=utf8&amp;nbsp;&amp;nbsp;
#password&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;k0Ui&amp;amp;wV(Z3ytport&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;3306&amp;nbsp;socket&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;/tmp/mysql.sock&amp;nbsp;&amp;nbsp;
&amp;nbsp;
#&amp;nbsp;Here&amp;nbsp;follows&amp;nbsp;entries&amp;nbsp;for&amp;nbsp;some&amp;nbsp;specific&amp;nbsp;programs&amp;nbsp;&amp;nbsp;
&amp;nbsp;#&amp;nbsp;The&amp;nbsp;MySQL&amp;nbsp;server&amp;nbsp;&amp;nbsp;&amp;nbsp;[mysqld]&amp;nbsp;&amp;nbsp;
&amp;nbsp;#配置mysql的文件夹&amp;nbsp;和&amp;nbsp;mysql&amp;nbsp;data目录basedir=/usr/local/mysql/mysql8.0datadir=/usr/local/mysql/mysql8.0/data
default-storage-engine=INNODB&amp;nbsp;&amp;nbsp;character-set-server=utf8&amp;nbsp;&amp;nbsp;
collation-server=utf8_general_ci&amp;nbsp;&amp;nbsp;
port&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;3306&amp;nbsp;socket&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;/tmp/mysql.sock&amp;nbsp;&amp;nbsp;
skip-external-locking&amp;nbsp;&amp;nbsp;
key_buffer_size&amp;nbsp;=&amp;nbsp;16K&amp;nbsp;&amp;nbsp;
max_allowed_packet&amp;nbsp;=&amp;nbsp;1M&amp;nbsp;&amp;nbsp;
table_open_cache&amp;nbsp;=&amp;nbsp;4&amp;nbsp;sort_buffer_size&amp;nbsp;=&amp;nbsp;64K&amp;nbsp;&amp;nbsp;
read_buffer_size&amp;nbsp;=&amp;nbsp;256K&amp;nbsp;&amp;nbsp;
read_rnd_buffer_size&amp;nbsp;=&amp;nbsp;256K&amp;nbsp;&amp;nbsp;
net_buffer_length&amp;nbsp;=&amp;nbsp;2K&amp;nbsp;&amp;nbsp;
thread_stack&amp;nbsp;=&amp;nbsp;128K&amp;nbsp;&amp;nbsp;
&amp;nbsp;
#&amp;nbsp;Don&amp;#39;t&amp;nbsp;listen&amp;nbsp;on&amp;nbsp;a&amp;nbsp;TCP/IP&amp;nbsp;port&amp;nbsp;at&amp;nbsp;all.&amp;nbsp;This&amp;nbsp;can&amp;nbsp;be&amp;nbsp;a&amp;nbsp;security&amp;nbsp;enhancement,&amp;nbsp;&amp;nbsp;#&amp;nbsp;if&amp;nbsp;all&amp;nbsp;processes&amp;nbsp;that&amp;nbsp;need&amp;nbsp;to&amp;nbsp;connect&amp;nbsp;to&amp;nbsp;mysqld&amp;nbsp;run&amp;nbsp;on&amp;nbsp;the&amp;nbsp;same&amp;nbsp;host.&amp;nbsp;&amp;nbsp;#&amp;nbsp;All&amp;nbsp;interaction&amp;nbsp;with&amp;nbsp;mysqld&amp;nbsp;must&amp;nbsp;be&amp;nbsp;made&amp;nbsp;via&amp;nbsp;Unix&amp;nbsp;sockets&amp;nbsp;or&amp;nbsp;named&amp;nbsp;pipes.&amp;nbsp;&amp;nbsp;#&amp;nbsp;Note&amp;nbsp;that&amp;nbsp;using&amp;nbsp;this&amp;nbsp;option&amp;nbsp;without&amp;nbsp;enabling&amp;nbsp;named&amp;nbsp;pipes&amp;nbsp;on&amp;nbsp;Windows&amp;nbsp;&amp;nbsp;#&amp;nbsp;(using&amp;nbsp;the&amp;nbsp;&amp;quot;enable-named-pipe&amp;quot;&amp;nbsp;option)&amp;nbsp;will&amp;nbsp;render&amp;nbsp;mysqld&amp;nbsp;useless!&amp;nbsp;&amp;nbsp;#&amp;nbsp;&amp;nbsp;&amp;nbsp;#skip-networking&amp;nbsp;&amp;nbsp;server-id&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;1&amp;nbsp;
&amp;nbsp;#&amp;nbsp;Uncomment&amp;nbsp;the&amp;nbsp;following&amp;nbsp;if&amp;nbsp;you&amp;nbsp;want&amp;nbsp;to&amp;nbsp;log&amp;nbsp;updates&amp;nbsp;&amp;nbsp;#log-bin=mysql-bin&amp;nbsp;&amp;nbsp;
&amp;nbsp;#&amp;nbsp;binary&amp;nbsp;logging&amp;nbsp;format&amp;nbsp;-&amp;nbsp;mixed&amp;nbsp;recommended&amp;nbsp;&amp;nbsp;#binlog_format=mixed&amp;nbsp;&amp;nbsp;
&amp;nbsp;#&amp;nbsp;Causes&amp;nbsp;updates&amp;nbsp;to&amp;nbsp;non-transactional&amp;nbsp;engines&amp;nbsp;using&amp;nbsp;statement&amp;nbsp;format&amp;nbsp;to&amp;nbsp;be&amp;nbsp;&amp;nbsp;#&amp;nbsp;written&amp;nbsp;directly&amp;nbsp;to&amp;nbsp;binary&amp;nbsp;log.&amp;nbsp;Before&amp;nbsp;using&amp;nbsp;this&amp;nbsp;option&amp;nbsp;make&amp;nbsp;sure&amp;nbsp;that&amp;nbsp;&amp;nbsp;#&amp;nbsp;there&amp;nbsp;are&amp;nbsp;no&amp;nbsp;dependencies&amp;nbsp;between&amp;nbsp;transactional&amp;nbsp;and&amp;nbsp;non-transactional&amp;nbsp;&amp;nbsp;#&amp;nbsp;tables&amp;nbsp;such&amp;nbsp;as&amp;nbsp;in&amp;nbsp;the&amp;nbsp;statement&amp;nbsp;INSERT&amp;nbsp;INTO&amp;nbsp;t_myisam&amp;nbsp;SELECT&amp;nbsp;*&amp;nbsp;FROM&amp;nbsp;&amp;nbsp;#&amp;nbsp;t_innodb;&amp;nbsp;otherwise,&amp;nbsp;slaves&amp;nbsp;may&amp;nbsp;diverge&amp;nbsp;from&amp;nbsp;the&amp;nbsp;master.&amp;nbsp;&amp;nbsp;#binlog_direct_non_transactional_updates=TRUE&amp;nbsp;&amp;nbsp;
&amp;nbsp;#&amp;nbsp;Uncomment&amp;nbsp;the&amp;nbsp;following&amp;nbsp;if&amp;nbsp;you&amp;nbsp;are&amp;nbsp;using&amp;nbsp;InnoDB&amp;nbsp;tables&amp;nbsp;&amp;nbsp;#innodb_data_home_dir&amp;nbsp;=&amp;nbsp;/usr/local/mysql/data&amp;nbsp;&amp;nbsp;#innodb_data_file_path&amp;nbsp;=&amp;nbsp;ibdata1:10M:autoextend&amp;nbsp;&amp;nbsp;#innodb_log_group_home_dir&amp;nbsp;=&amp;nbsp;/usr/local/mysql/data&amp;nbsp;&amp;nbsp;#&amp;nbsp;You&amp;nbsp;can&amp;nbsp;set&amp;nbsp;.._buffer_pool_size&amp;nbsp;up&amp;nbsp;to&amp;nbsp;50&amp;nbsp;-&amp;nbsp;80&amp;nbsp;%&amp;nbsp;&amp;nbsp;#&amp;nbsp;of&amp;nbsp;RAM&amp;nbsp;but&amp;nbsp;beware&amp;nbsp;of&amp;nbsp;setting&amp;nbsp;memory&amp;nbsp;usage&amp;nbsp;too&amp;nbsp;high&amp;nbsp;&amp;nbsp;#innodb_buffer_pool_size&amp;nbsp;=&amp;nbsp;16M&amp;nbsp;&amp;nbsp;#innodb_additional_mem_pool_size&amp;nbsp;=&amp;nbsp;2M&amp;nbsp;&amp;nbsp;#&amp;nbsp;Set&amp;nbsp;.._log_file_size&amp;nbsp;to&amp;nbsp;25&amp;nbsp;%&amp;nbsp;of&amp;nbsp;buffer&amp;nbsp;pool&amp;nbsp;size&amp;nbsp;&amp;nbsp;#innodb_log_file_size&amp;nbsp;=&amp;nbsp;5M&amp;nbsp;&amp;nbsp;#innodb_log_buffer_size&amp;nbsp;=&amp;nbsp;8M&amp;nbsp;&amp;nbsp;#innodb_flush_log_at_trx_commit&amp;nbsp;=&amp;nbsp;1&amp;nbsp;#innodb_lock_wait_timeout&amp;nbsp;=&amp;nbsp;50&amp;nbsp;
&amp;nbsp;[mysqldump]&amp;nbsp;&amp;nbsp;quick&amp;nbsp;&amp;nbsp;
max_allowed_packet&amp;nbsp;=&amp;nbsp;16M&amp;nbsp;&amp;nbsp;
&amp;nbsp;
[mysql]&amp;nbsp;&amp;nbsp;no-auto-rehash&amp;nbsp;&amp;nbsp;
#&amp;nbsp;Remove&amp;nbsp;the&amp;nbsp;next&amp;nbsp;comment&amp;nbsp;character&amp;nbsp;if&amp;nbsp;you&amp;nbsp;are&amp;nbsp;not&amp;nbsp;familiar&amp;nbsp;with&amp;nbsp;SQL&amp;nbsp;&amp;nbsp;#safe-updates&amp;nbsp;&amp;nbsp;
&amp;nbsp;[myisamchk]&amp;nbsp;&amp;nbsp;key_buffer_size&amp;nbsp;=&amp;nbsp;8M&amp;nbsp;&amp;nbsp;
sort_buffer_size&amp;nbsp;=&amp;nbsp;8M&amp;nbsp;&amp;nbsp;
&amp;nbsp;
[mysqlhotcopy]&amp;nbsp;&amp;nbsp;interactive-timeout&lt;/pre&gt;&lt;p&gt;*设置my.cnf权限&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;sudo chmod 664 /etc/my.cnf&lt;/p&gt;&lt;/blockquote&gt;&lt;h3&gt;4、启动mysql服务&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;service mysql start&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;strong&gt;如果出现下面报错&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot;image-package&quot;&gt;&lt;div class=&quot;image-container&quot; style=&quot;max-width: 614px; max-height: 43px;&quot;&gt;&lt;div class=&quot;image-view&quot; data-width=&quot;614&quot; data-height=&quot;43&quot;&gt;&lt;img data-original-src=&quot;//upload-images.jianshu.io/upload_images/27055388-3dd9f27cd3b4ee9d.png&quot; data-original-width=&quot;614&quot; data-original-height=&quot;43&quot; data-original-format=&quot;image/png&quot; data-original-filesize=&quot;9409&quot; data-image-index=&quot;1&quot; style=&quot;cursor: zoom-in;&quot; class=&quot;&quot; src=&quot;//upload-images.jianshu.io/upload_images/27055388-3dd9f27cd3b4ee9d.png?imageMogr2/auto-orient/strip|imageView2/2/w/614/format/webp&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;image-caption&quot;&gt;file&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;解决&lt;/strong&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;将/var/lock/subsys/下mysql文件删除&lt;/p&gt;&lt;/blockquote&gt;&lt;h3&gt;5、查看mysql服务状态&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;service mysql status&lt;/p&gt;&lt;/blockquote&gt;&lt;h3&gt;6、将mysql命令添加到服务&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;ln -s /usr/local/mysql/mysql8.0/bin/mysql /usr/bin&lt;/p&gt;&lt;/blockquote&gt;&lt;h2&gt;六、登录mysql&lt;/h2&gt;&lt;h3&gt;1、登录 密码使用之前随机生成的密码&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;mysql &amp;nbsp;mysql -uroot -p&lt;/p&gt;&lt;/blockquote&gt;&lt;div class=&quot;image-package&quot;&gt;&lt;div class=&quot;image-container&quot; style=&quot;max-width: 457px; max-height: 40px;&quot;&gt;&lt;div class=&quot;image-view&quot; data-width=&quot;457&quot; data-height=&quot;40&quot;&gt;&lt;img data-original-src=&quot;//upload-images.jianshu.io/upload_images/27055388-d5604a5da08565e1.png&quot; data-original-width=&quot;457&quot; data-original-height=&quot;40&quot; data-original-format=&quot;image/png&quot; data-original-filesize=&quot;5452&quot; data-image-index=&quot;2&quot; style=&quot;cursor: zoom-in;&quot; class=&quot;&quot; src=&quot;//upload-images.jianshu.io/upload_images/27055388-d5604a5da08565e1.png?imageMogr2/auto-orient/strip|imageView2/2/w/457/format/webp&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;2、修改管理员密码 &amp;nbsp;其中123456是新的密码自己设置&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;ALTER USER &amp;#39;root&amp;#39;@&amp;#39;localhost&amp;#39; IDENTIFIED WITH mysql_native_password BY &amp;#39;123456&amp;#39;;&lt;/p&gt;&lt;/blockquote&gt;&lt;div class=&quot;image-package&quot;&gt;&lt;div class=&quot;image-container&quot; style=&quot;max-width: 700px; max-height: 63px;&quot;&gt;&lt;div class=&quot;image-view&quot; data-width=&quot;832&quot; data-height=&quot;63&quot;&gt;&lt;img data-original-src=&quot;//upload-images.jianshu.io/upload_images/27055388-4a4fe3f9d3dc64a7.png&quot; data-original-width=&quot;832&quot; data-original-height=&quot;63&quot; data-original-format=&quot;image/png&quot; data-original-filesize=&quot;9981&quot; data-image-index=&quot;3&quot; style=&quot;cursor: zoom-in;&quot; class=&quot;&quot; src=&quot;//upload-images.jianshu.io/upload_images/27055388-4a4fe3f9d3dc64a7.png?imageMogr2/auto-orient/strip|imageView2/2/w/832/format/webp&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;3、重新加载缓存，使密码生效&lt;/h3&gt;&lt;blockquote&gt;&lt;p&gt;flush privileges；&lt;/p&gt;&lt;/blockquote&gt;&lt;h3&gt;4、退出mysql，用新密码尝试登录管理员&lt;/h3&gt;&lt;h2&gt;七、修改mysql配置，使其可以用工具远程登录&lt;/h2&gt;&lt;blockquote&gt;&lt;p&gt;update user set host=&amp;#39;%&amp;#39; where user=&amp;#39;root&amp;#39;;&lt;/p&gt;&lt;p&gt;flush privileges;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2&gt;云服务器不能远程连接mysql，解决&lt;/h2&gt;&lt;p&gt;如果是买的云服务器，例如：阿里云服务器的，请到设置mysql(3306)安全策略&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742547478356818.webp&quot; alt=&quot;14f6ce2e6f3ba700b842fd3f9bb6b6c7_webp.webp&quot;/&gt;&lt;/p&gt;</description><pubDate>Fri, 21 Mar 2025 16:53:35 +0800</pubDate></item><item><title>Centos7安装MySQL8.0详细教程（压缩包安装方式）</title><link>http://x.zx.cdqlx.top/?id=32</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;下载MySQL&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;下载地址： https://downloads.mysql.com/archives/community/&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490206604517.webp&quot; alt=&quot;c457fbb604971f35a37362b55e69ab8e_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;这里需要知道自己的linux的glibc版本，不然安装的时候会提示glibc版本过低。查询方法如下：&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;rpm -q glibc&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490239818296.webp&quot; alt=&quot;1965c98597831b7a6c5f5eb4aeea330e_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;下载之后，将压缩包上传到服务器上，准备安装MySQL。&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490253139050.webp&quot; alt=&quot;5318fee5bb3b84396fbe6deefe7f0d74_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;三、安装步骤&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;说明：本次安装教程，是在之前没有安装过MySQL的系统上进行的，如果你之前&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;安装过MySQL需要将MySQL相关的配置进行删除，包括用户组，以及MySQL相&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;关的文件夹，避免在安装过程中出现错误。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1、解压安装包&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;将MySQL压缩包解压到/usr/local/mysql目录中。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;mkdir -p /usr/local/mysql
tar --strip-components=1 -xvf mysql-8.0.39-linux-glibc2.17-x86_64.tar.xz &amp;nbsp;-C /usr/local/mysql&lt;/span&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490297506657.webp&quot; alt=&quot;ec47751c0182387bdabaf8988022d6f2_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2、创建MySQL组和用户&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;# 创建用户组
groupadd mysql
# 创建用户并加入mysql用户组
useradd -g mysql mysql&lt;/span&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490331649999.webp&quot; alt=&quot;06cc3b459d0f2e2bcbf6fe00c898b774_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;3、更改所属的组和用户&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #F7F7F7; font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve;&quot;&gt;# 进入到/usr/local目录&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;cd /usr/local

chown -R mysql mysql/
chgrp -R mysql mysql/
chown -R mysql:mysql /usr/local/mysql

# 进入到mysql目录，创建data和logs目录
cd mysql &amp;amp;&amp;amp; mkdir -p data logs &amp;amp;&amp;amp; chown -R mysql:mysql data logs&lt;/span&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490359691570.webp&quot; alt=&quot;b50b05af2ec5bb30a6ebebe83a7b913a_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;4、新建MySQL配置文件&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;vim /etc/my.cnf&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;[mysql]
#设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
#禁用dns解析
skip-name-resolve
#设置3306端口
port = 3306
#设置mysql的安装目录
basedir=/usr/local/mysql
#设置mysql数据库的数据的存放目录
datadir=/usr/local/mysql/data
#允许最大连接数
max_connections=200
#允许连接失败的次数
max_connect_errors=10
#服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
#创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
#默认使用“mysql_native_password”插件认证
default_authentication_plugin=mysql_native_password
#设置服务器接收数据包大小
max_allowed_packet=64M
#配置错误日志
log_error=/usr/local/mysql/logs/mysql-error.log
#配置进程文件
pid-file=/usr/local/mysql/mysql.pid
#设置客户端发送数据包大小
max_allowed_packet=64M
#使MySQL不区分大小写
lower_case_table_names=1&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;给配置文件赋予权限&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;chown 777 /etc/my.cnf&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;5、初始化MySQL&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;./bin/mysqld --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ --initialize&lt;/span&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490438787783.webp&quot; alt=&quot;8039856b886a93e87fca2e5dbd1970cb_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;6、添加mysql服务，并设置开机自启&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;cp -a /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/rc.d/init.d/mysql
chkconfig --add mysql
chkconfig --level 345 mysql on
ln -s /usr/local/mysql/bin/mysql /usr/bin&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490467645418.webp&quot; alt=&quot;6de8cfebd69baafedaf337e35369f1f5_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;四、启动MySQL服务&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #F7F7F7; font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve;&quot;&gt;# 启动&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;service mysql start
# 查看状态
service mysql status
# 停止
service mysql stop&lt;/span&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490497115231.webp&quot; alt=&quot;599bac01d2dcb80102949820655e93dd_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;五、查看临时密码，并登陆MySQL&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;cat /usr/local/mysql/logs/mysql-error.log&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490517714897.webp&quot; alt=&quot;415d9fef1db556d15e3c3f57d9f0514d_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;mysql -u root -p&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;填写临时密码，注意密码输入的时候是不可见的，直接复制粘贴密码即可。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490543536754.webp&quot; alt=&quot;5431b53056ff0bbd98e6f6283c3573a2_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;六、修改密码&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;初次使用的时候，需要先修改密码，否则会报以上错误&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;ALTER USER &amp;#39;root&amp;#39;@&amp;#39;localhost&amp;#39; IDENTIFIED WITH mysql_native_password BY &amp;#39;123456&amp;#39;;
flush privileges;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490580472424.webp&quot; alt=&quot;df3252b0bc7360b7c3946be3406674c1_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;七、开启远程访问&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;如果你需要开启远程访问，可以用以下方式完成&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;注意事项：如果是虚拟机，记得关闭防火墙或者添加3306端口开放，如果是服务器，记得在服务器后台中的安全组中添加3306端口开放，&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;否则远程连接的时候，会连接不上，在远程连接的时候，切勿使用弱密码，否则数据库会被脚本工具扫描，会造成不可估量的损失。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;use mysql;
update user set host = &amp;#39;%&amp;#39; where user = &amp;#39;root&amp;#39;;
flush privileges;
select host, user from user;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace; white-space-collapse: preserve; background-color: #F7F7F7;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/03/202503211742490601641938.webp&quot; alt=&quot;acd5629154c58e0f808eaee8fa6ed898_resize,m_fixed,w_1184.webp&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Fri, 21 Mar 2025 00:59:07 +0800</pubDate></item><item><title>使用nginx让nps内网穿透的网站支持https</title><link>http://x.zx.cdqlx.top/?id=31</link><description>&lt;h2 class=&quot;wp-block-heading&quot; id=&quot;header-id-1&quot; style=&quot;box-sizing: border-box; margin-bottom: 15px; font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; line-height: 1.5; color: rgb(50, 50, 93); font-size: 26px; text-wrap: wrap; background-color: rgb(237, 247, 254); margin-top: 18px !important;&quot;&gt;00.nps配置&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;因为nginx需要监听80与443端口，而nps的http和https默认代理端口也是80与443端口，所以我们需要修改nps的配置&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;进入nps的根目录，本人这里是/opt/nps/，但是很多人是/etc/nps&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;进入conf文件夹，编辑nps.conf文件，找到以下代码块&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;#HTTP(S)&amp;nbsp;proxy&amp;nbsp;port,&amp;nbsp;no&amp;nbsp;startup&amp;nbsp;if&amp;nbsp;empty
http_proxy_ip=0.0.0.0
http_proxy_port=80
https_proxy_port=443
https_just_proxy=true&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;将其中的80和443端口改成你想要的就可以了，https可以留空，因为我们直接用nginx强制使用https即可，就不需要https代理了&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;然后重启nps:&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;sudo&amp;nbsp;systemctl&amp;nbsp;restart&amp;nbsp;nps&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;我这里将http代理端口设置为8010，https端口设置为空&lt;/p&gt;&lt;h2 class=&quot;wp-block-heading&quot; id=&quot;header-id-2&quot; style=&quot;box-sizing: border-box; margin-bottom: 15px; font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; line-height: 1.5; color: rgb(50, 50, 93); font-size: 26px; text-wrap: wrap; background-color: rgb(237, 247, 254); margin-top: 18px !important;&quot;&gt;01.新建域名解析(如果之前没有)&lt;/h2&gt;&lt;p&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;box-sizing: border-box; margin: 3rem 0px; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; font-size: 16px; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;&lt;div class=&quot;fancybox-wrapper&quot; data-fancybox=&quot;post-images&quot; href=&quot;https://charsama.cn/wp-content/uploads/2025/01/image-1-2048x983.png&quot; style=&quot;box-sizing: border-box; width: unset; max-width: 100%;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/02/20250227112412174062665226401.png&quot;&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;这里的主机指的是用户访问的地址，也就是用户输入地址栏的地址。只有nps识别到用户从主机一模一样的域名进来，才会给你内网穿透&lt;/p&gt;&lt;h2 class=&quot;wp-block-heading&quot; id=&quot;header-id-3&quot; style=&quot;box-sizing: border-box; margin-bottom: 15px; font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; line-height: 1.5; color: rgb(50, 50, 93); font-size: 26px; text-wrap: wrap; background-color: rgb(237, 247, 254); margin-top: 18px !important;&quot;&gt;02.nginx与nps配合的配置&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;先上配置文件(里面的charsama.cn要改为你自己的域名)：&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;events&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;worker_connections&amp;nbsp;1024;
}

http&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;1.&amp;nbsp;主域名的&amp;nbsp;HTTP&amp;nbsp;重定向到&amp;nbsp;HTTPS
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;server&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;listen&amp;nbsp;80;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;server_name&amp;nbsp;charsama.cn;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;301&amp;nbsp;https://charsama.cn$request_uri;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;2.&amp;nbsp;强制将&amp;nbsp;www.charsama.cn&amp;nbsp;的&amp;nbsp;HTTP&amp;nbsp;重定向到&amp;nbsp;HTTPS&amp;nbsp;主域名
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;server&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;listen&amp;nbsp;80;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;server_name&amp;nbsp;www.charsama.cn;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;301&amp;nbsp;https://charsama.cn$request_uri;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;3.&amp;nbsp;强制将&amp;nbsp;HTTPS&amp;nbsp;的&amp;nbsp;www.charsama.cn&amp;nbsp;重定向到主域名
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;server&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;listen&amp;nbsp;443&amp;nbsp;ssl;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;server_name&amp;nbsp;www.charsama.cn;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssl_certificate&amp;nbsp;/etc/nginx/conf.d/charsama.cn/fullchain.pem;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssl_certificate_key&amp;nbsp;/etc/nginx/conf.d/charsama.cn/privkey.pem;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;301&amp;nbsp;https://charsama.cn$request_uri;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;4.&amp;nbsp;主域名&amp;nbsp;HTTPS&amp;nbsp;配置
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;server&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;listen&amp;nbsp;443&amp;nbsp;ssl;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;server_name&amp;nbsp;charsama.cn;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssl_certificate&amp;nbsp;/etc/nginx/conf.d/charsama.cn/fullchain.pem;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssl_certificate_key&amp;nbsp;/etc/nginx/conf.d/charsama.cn/privkey.pem;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssl_session_timeout&amp;nbsp;5m;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssl_protocols&amp;nbsp;TLSv1.1&amp;nbsp;TLSv1.2&amp;nbsp;TLSv1.3;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssl_ciphers&amp;nbsp;EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssl_prefer_server_ciphers&amp;nbsp;on;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;add_header&amp;nbsp;Strict-Transport-Security&amp;nbsp;&amp;quot;max-age=31536000&amp;quot;;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;access_log&amp;nbsp;/var/log/nginx/charsama.cn.https.log;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;location&amp;nbsp;/&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;proxy_pass&amp;nbsp;http://127.0.0.1:8010;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;proxy_set_header&amp;nbsp;Host&amp;nbsp;$host;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;proxy_set_header&amp;nbsp;X-Real-IP&amp;nbsp;$remote_addr;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;proxy_set_header&amp;nbsp;X-Forwarded-For&amp;nbsp;$proxy_add_x_forwarded_for;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;proxy_set_header&amp;nbsp;X-Forwarded-Proto&amp;nbsp;$scheme;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
}&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;前面三个都是用于强制跳转的，效果大概是:&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;https://charsama.cn&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;gt;&amp;nbsp;https://charsama.cn
http://www.charsama.cn&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;gt;&amp;nbsp;https://charsama.cn
https://www.charsama.cn&amp;nbsp;&amp;nbsp;-&amp;gt;&amp;nbsp;https://charsama.cn&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;最后一个server中的proxy_pass http://127.0.0.1:8010;就是将请求发送到nps大的http代理端口，我之前设置的是8010，你们如果设置的是其它端口就设置为proxy_pass http://127.0.0.1:[其它端口];&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;原理就是，你给nps发送了用户的host，也就是用户访问的主机名，然后nps通过8010端口接收并从域名解析中对比主机名，哪个对上了就内网穿透哪一个&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssl_certificate&amp;nbsp;/etc/nginx/conf.d/charsama.cn/fullchain.pem;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssl_certificate_key&amp;nbsp;/etc/nginx/conf.d/charsama.cn/privkey.pem;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;这两行是证书，我们等会就会去申请&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;将这些配置修改成你的域名之后，进入nginx根目录&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;cd&amp;nbsp;/etc/nginx&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;把上面的所有内容（你修改过后的）全部替换你nginx.conf里面的内容（如果你曾经修改过里面的东西请酌情保留）&lt;/p&gt;&lt;h2 class=&quot;wp-block-heading&quot; id=&quot;header-id-4&quot; style=&quot;box-sizing: border-box; margin-bottom: 15px; font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; line-height: 1.5; color: rgb(50, 50, 93); font-size: 26px; text-wrap: wrap; background-color: rgb(237, 247, 254); margin-top: 18px !important;&quot;&gt;03.申请证书&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;进入 https://httpsok.com/ 网页（如果不介意的话可以进入我的邀请页面https://httpsok.com/p/4ODl，虽然对我帮助可能不是特别大但是羊毛谁不爱薅呢？）&lt;/p&gt;&lt;p&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;box-sizing: border-box; margin: 3rem 0px; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; font-size: 16px; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;&lt;div class=&quot;fancybox-wrapper&quot; data-fancybox=&quot;post-images&quot; href=&quot;https://charsama.cn/wp-content/uploads/2025/01/image-2-2048x705.png&quot; style=&quot;box-sizing: border-box; width: unset; max-width: 100%;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/02/20250227112414174062665490473.png&quot;&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;找到证书管理，点击免费申请证书（才发现我做演示申请的证书也被算进免费额度里了）&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;按照httpsok网站提供的指示，填写域名cname的记录，直接复制粘贴就好了（&lt;/p&gt;&lt;p&gt;&lt;figure class=&quot;wp-block-image size-full&quot; style=&quot;box-sizing: border-box; margin: 3rem 0px; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; font-size: 16px; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;&lt;div class=&quot;fancybox-wrapper&quot; data-fancybox=&quot;post-images&quot; href=&quot;https://charsama.cn/wp-content/uploads/2025/01/image-3.png&quot; style=&quot;box-sizing: border-box; width: unset; max-width: 100%;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/02/20250227112417174062665759425.png&quot;&gt;&lt;/div&gt;&lt;/figure&gt;&lt;figure class=&quot;wp-block-image size-full&quot; style=&quot;box-sizing: border-box; margin: 3rem 0px; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; font-size: 16px; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;&lt;div class=&quot;fancybox-wrapper&quot; data-fancybox=&quot;post-images&quot; href=&quot;https://charsama.cn/wp-content/uploads/2025/01/image-4.png&quot; style=&quot;box-sizing: border-box; width: unset; max-width: 100%;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/02/20250227112419174062665975583.png&quot;&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;保存之后直接验证，验证通过后就可以直接申请了，申请完毕之后我们回到证书管理页面，下载证书，直接下载nginx版本的。可以先点击下载之后复制下载链接，然后到服务器使用wget [下载链接]，然后unzip解压，也可以直接通过其他应用上传到服务器里&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;进入nginx的conf.d文件夹，一般是/etc/nginx/conf.d/&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;cd&amp;nbsp;/etc/nginx/conf.d&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;在此处创建一个与你域名相同的文件夹&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;mkdir&amp;nbsp;domain.com(替换成你的域名)&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;进入这个文件夹&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;cd&amp;nbsp;domain.com(替换成你的域名)&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;然后把你刚才下载的证书（解压过后的.pem文件）移动到这里（或者直接在这里下载也行）&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;然后返回到nginx根目录&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;cd&amp;nbsp;/etc/nginx&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;我们再次打开httpsok网站找到自动部署，复制nginx的自动部署命令，大概长这个样子（每个人的都不一样，不要复制我的！！）&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;curl&amp;nbsp;-s&amp;nbsp;https://get.httpsok.com/&amp;nbsp;|&amp;nbsp;bash&amp;nbsp;-s&amp;nbsp;9aN0RN3y4hczqP9wL4&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;注意：非root用户要在bash前面加上sudo，大概是这样子：&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;curl&amp;nbsp;-s&amp;nbsp;https://get.httpsok.com/&amp;nbsp;|&amp;nbsp;sudo&amp;nbsp;bash&amp;nbsp;-s&amp;nbsp;9aN0RN3y4hczqP9wL4&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;然后你会看到这样的回应，如果不是那你就失败了（&lt;/p&gt;&lt;p&gt;&lt;figure class=&quot;wp-block-image size-large&quot; style=&quot;box-sizing: border-box; margin: 3rem 0px; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; font-size: 16px; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;&lt;div class=&quot;fancybox-wrapper&quot; data-fancybox=&quot;post-images&quot; href=&quot;https://charsama.cn/wp-content/uploads/2025/01/image-5-2048x1181.png&quot; style=&quot;box-sizing: border-box; width: unset; max-width: 100%;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2025/02/20250227112421174062666121096.png&quot;&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;如果出现相同的回应，就说明你成功了。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;完事了之后重启下nginx:&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;sudo&amp;nbsp;systemctl&amp;nbsp;restart&amp;nbsp;nginx&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;访问你的域名，这个时候你应该看到你的网站正常运行，并且具有https保护&lt;/p&gt;&lt;h2 class=&quot;wp-block-heading&quot; id=&quot;header-id-5&quot; style=&quot;box-sizing: border-box; margin-bottom: 15px; font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; line-height: 1.5; color: rgb(50, 50, 93); font-size: 26px; text-wrap: wrap; background-color: rgb(237, 247, 254); margin-top: 18px !important;&quot;&gt;04.一些小问题&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;wordpress（或者其他服务）如果出现资源缺失等问题请开启wordpress的https模式&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;修改wordpress根目录（或者docker容器内的wp-config.php)&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; font-size: 16px; line-height: 1.8; overflow-wrap: break-word; color: rgb(82, 95, 127); font-family: &amp;quot;Open Sans&amp;quot;, -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, SimSun, sans-serif; text-wrap: wrap; background-color: rgb(237, 247, 254);&quot;&gt;添加这三行就行了：&lt;/p&gt;&lt;pre class=&quot;wp-block-code&quot; style=&quot;box-sizing: border-box; font-family: Consolas, Menlo, Monaco, &amp;quot;Andale Mono WT&amp;quot;, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Lucida Sans Typewriter&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;Nimbus Mono L&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; overflow: auto; margin-top: 0px; margin-bottom: 1rem; color: rgb(94, 102, 135); line-height: 1.375; word-break: normal; tab-size: 4; hyphens: none; background: var(--color-border-on-foreground); direction: ltr; border: 1px solid var(--color-border-on-foreground-deeper); padding: 14px; border-radius: 3px;&quot;&gt;$_SERVER[&amp;#39;HTTPS&amp;#39;]&amp;nbsp;=&amp;nbsp;&amp;#39;on&amp;#39;;
define(&amp;#39;FORCE_SSL_LOGIN&amp;#39;,&amp;nbsp;true);
define(&amp;#39;FORCE_SSL_ADMIN&amp;#39;,&amp;nbsp;true);&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Thu, 27 Feb 2025 11:22:58 +0800</pubDate></item><item><title>T3如何利用系统工具导入导出复制存货档案详细教程</title><link>http://x.zx.cdqlx.top/?id=30</link><description>&lt;h2 data-lake-id=&quot;b2bacbfe4f1538cc0e5ecc3111e3ee74&quot; id=&quot;BmhB9&quot; style=&quot;box-sizing: border-box; margin: 0px 0px 0.5rem; padding: 0px; font-weight: 500; line-height: 1.2; font-size: 2rem; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; font-weight: bolder;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; font-weight: bolder;&quot;&gt;T3如何利用系统工具导入导出复制存货档案&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;p data-lake-id=&quot;2174b8d6b8d8a96307a0e8530e0279e7&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;h2 data-lake-id=&quot;513a94980d87e7c08d9d96f8f4308650&quot; id=&quot;czx8n&quot; style=&quot;box-sizing: border-box; margin: 0px 0px 0.5rem; padding: 0px; font-weight: 500; line-height: 1.2; font-size: 2rem; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;&quot;&gt;问题现象：&lt;/span&gt;&lt;/h2&gt;&lt;p data-lake-id=&quot;46261bad2383730286df4eca8d8079cc&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;如何把旧账的存货档案复制到新建一个公司帐，如何在系统工具中操作？&lt;/span&gt;&lt;/p&gt;&lt;h2 data-lake-id=&quot;8e7fb7065a1626f5cac18f559e43cf09&quot; id=&quot;ouLB0&quot; style=&quot;box-sizing: border-box; margin: 0px 0px 0.5rem; padding: 0px; font-weight: 500; line-height: 1.2; font-size: 2rem; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;&quot;&gt;解决方案：&lt;/span&gt;&lt;/h2&gt;&lt;p data-lake-id=&quot;9d826fbc916d17136830c8e38c34c271&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;1、点击电脑左下角“开始”-“程序”-“T3系列管理软件”-“T3”-“系统工具”，在此注册控制台界面输入（用户名、密码、选择帐套、操作日期）点击“确定”按钮，如下图；&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;d0dd6b8f871c038e41485d68fd970066&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241016140631172905879182001.png&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;f891fcffa2a18db2293f0f687695f826&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;2、注册控制台确定后，进入“导航图”界面选择数据“导入导出”如下图；&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;1ab8bbcc72e6b8bc3fee245322085fe0&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241016140632172905879240318.png&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;fb667ddd291d33458102371a51fe7be3&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;3、点击“数据导入导出”完后，进入“导入导出”界面，选择“可选项目”-“基础档案”-“存货档案”；“已选项目”-“存货档案”；“选项”-“用友通数据导出excel文件”点击“设置”按钮，如下图；&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;3955794fc51a6b9945bf3067552cf5ff&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241016140632172905879240583.png&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;f6b46257e7b58cd31c7334ba265cb53d&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;4、点击设置按钮之后，“导入导出项目”选择“存货档案”；“导出excel，默认文件路径”选择电脑桌面上“我的文档”-“基础档案”文件，点击确定和保存全部按钮，退出回到导入导出界面点击“执行”按钮，会显示结果，如下图；&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;e135eed1b50dfca2a5a75a9461f07661&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241016140632172905879286920.png&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;fd50a2342197ce7550d662d15addb2b9&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241016140632172905879242377.png&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;a12e4ec06bad822314ad49e09f01ffd7&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;5、结果显示完后，点击关闭按钮，回到桌面-“我的文档”-“基础档案”-“存货档案”查询结果，如下图；&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;a8ffacb69be4b266d4855015a76c5ed2&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241016140632172905879244981.png&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;6ffbf0718c3899d518145838a51e0258&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;6、导出成功之后，进行导入数据，再“系统工具-导航图”界面-“文件”-“重新注册”，再注册控制台界面输入（用户名、密码、选择帐套（此时选择新帐套010）、操作日期）点击“确定”按钮，如下图；&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;44970f51f30969f78c85b8ea0b8b340c&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241016140632172905879285900.png&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;1cc106caaa42a1fb199271a4cccefac4&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;7、注册控制台确定后，进入“导航图”界面选择数据“导入导出”如下图；&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;d21484a8d18e8fb739bcade49734e20b&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241016140632172905879226615.png&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;6513632959feb9c99d27f606f636190d&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;8、点击“数据导入导出”完后，进入“导入导出”界面，选择“可选项目”-“基础档案”-“存货档案”；“已选项目”-“存货档案”；“选项”-“外部excel文件数据导入到用友通”点击“设置”按钮，如下图；&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;044889ecb52112ca961310cb653e0a69&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241016140632172905879243524.png&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;2b28e13cb1b31501a993a13cc3a13518&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;9、点击设置按钮之后，“导入导出项目”选择“存货档案”；“导入excel，默认文件路径”选择电脑桌面上“我的文档”-“基础档案”-“存货档案”文件，点击确定和保存全部按钮，退出回到导入导出界面点击“执行”按钮，会显示结果，如下图；&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;00e1354335237897bd372f3fceb04299&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241016140632172905879220974.png&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;a24afd2b1aa391cd355196694af6b0a0&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241016140633172905879321959.png&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;aebcb380c0e7ebf7d86dd44f19a6c3d9&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;10、导入数据成功后，重新登入T3软件选着【010】 帐套-“基础设置”-“存货”-“存货档案”，查询导入的结果，如下图；&lt;/span&gt;&lt;/p&gt;&lt;p data-lake-id=&quot;1bbc121fe8cd79477a9a5894df23fb68&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding: 0px; color: rgb(255, 80, 79); font-family: 微软雅黑, arial, 宋体, helvetica, sans-serif; letter-spacing: 1.5px; text-wrap: wrap;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241016140633172905879342993.png&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 16 Oct 2024 14:05:39 +0800</pubDate></item><item><title>自己搭建远程桌面服务器-RustDesk（小白版</title><link>http://x.zx.cdqlx.top/?id=29</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1.RustDesk简介&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;此软件主要功能为远程各种设备（其中包括Windows、macOS、Linux、iOS、Android、Web等）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;支持文件传输（可直接拷贝远程电脑的文件，类似向日葵的远程文件）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;支持内网穿透（支持端口映射，TCP/UDP，支持Windows默认远程桌面应用）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;最主要优点为可远程Android，本人最爱，简单配置，可帮助老家父母直接操控手机，解决他们使用手机过程中的问题&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2.同类型软件对比（我已知的）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2.1 向日葵&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;①网络差&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;②不能高清分辨率&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;③不支持自建服务器&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;④使用第三方网络转发不安全&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;⑤不支持内网穿透（端口映射）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;⑥不能满足所有设备（我知道的安卓就不可以）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2.2 frp&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;①部署不方便&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;②只能使用Windows自带远程桌面&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;③每次端口映射都需要修改配置文件并且重启服务&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;④不能满足所有设备（好像只能电脑使用）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2.3 TeamViewer&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;不过多介绍 好多年就不用了（我记的疫情期间居家办公直接卡的要死，之后就没在用过）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2.4 ToDesk/RayLink&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;①不能满足所有设备（安卓不能使用）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;②不支持自建服务器&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;③使用第三方网络转发不安全&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;④不支持内网穿透（端口映射）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;3.远程软件推荐&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;如果自己没有服务器，远程桌面我推荐使用向日葵、ToDesk、RayLink（这些都不支持安卓）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;如果想使用内网穿透，我建议使用花生壳、NAT123（早些年非常好用、现在弄得特别复杂）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;自己有服务器，穿透可使用RustDesk、frp&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;本人目前使用为RustDesk、向日葵混合使用。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;4.准备内容&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;① 一个公网服务器（可装Centos7.6或Windows系统）建议使用Centos 可以命令部署&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;如果没有服务器，可自行到腾讯云、阿里云申请（一般都会有活动什么年终、双十一、双十二等等，价格不贵，便宜的100多一年，学生会有学生优惠，更便宜 。本人就不在此处推销链接了）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;② RustDesk服务端软件、客户端软件、Android等（国内GitHub访问慢，我会打包放在下面）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;RustDesk.exe&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;https://www.alipan.com/s/FFwnJQBr6dg&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;提取码: m38i&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;点击链接保存，或者复制本段内容，打开「阿里云盘」APP ，无需下载极速在线查看，视频原画倍速播放。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;③服务器防火墙需要将以下内容加入到白名单&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;TCP(21115, 21116, 21117, 21118, 21119)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;UDP(21116)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;hbbs 监听21115(tcp), 21116(tcp/udp), 21118(tcp)，hbbr 监听21117(tcp), 21119(tcp)。务必在防火墙开启这几个端口， 请注意21116同时要开启TCP和UDP。其中21115是hbbs用作NAT类型测试，21116/UDP是hbbs用作ID注册与心跳服务，21116/TCP是hbbs用作TCP打洞与连接服务，21117是hbbr用作中继服务, 21118和21119是为了支持网页客户端。如果您不需要网页客户端（21118，21119）支持，对应端口可以不开。&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;5.开始操作&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1.服务端Centos7.6（系统为Linux使用此方式）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;服务端软件是部署在Docker上，建议先安装Docke（安装Docker方法自行百度）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;执行下述命令&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;1.拉取RustDesk镜像&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;sudo docker image pull rustdesk/rustdesk-server&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp;阿里云加速使用这个&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;sudo docker image pull thtom/rustdesk-server&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2.启动hbbs服务&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;sudo docker run --name hbbs -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v `pwd`:/root -td --net=host rustdesk/rustdesk-server hbbs&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp;阿里云加速使用这个&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;sudo docker run --name hbbs -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v `pwd`:/root -td --net=host thtom/rustdesk-server hbbs&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;3.启动hbbr服务&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;sudo docker run --name hbbr -p 21117:21117 -p 21119:21119 -v `pwd`:/root -td --net=host rustdesk/rustdesk-server hbbr&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;阿里云加速使用这个&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;sudo docker run --name hbbr -p 21117:21117 -p 21119:21119 -v `pwd`:/root -td --net=host thtom/rustdesk-server hbbr&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;4.查看Docker容器启动情况&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;docker ps -a&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp;确认hbbs、hbbr容器为Up状态&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;2.服务端Windows（系统为Windows使用此方式）&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;解压软件包后点击RustDeskServer.Setup.exe按步骤安装，安装完成后在界面上点击Start&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;3.客户端Windows&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;安装客户端软件，点击三个点&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/202410081728321536123923.png&quot; alt=&quot;13e6f3252d6826d55f0e0b15b8270e9e_d8d5553588695996e41f43cac077bb3e.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp;选择网络-&amp;gt;点击解锁网络设置-&amp;gt;将服务器IP填写到ID服务器中，被控端可以不填写中继服务器，控制端建议填写，都是服务器IP -&amp;gt; 点击应用 然后就可以使用远程ID去控制电脑了&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/202410081728321552110243.png&quot; alt=&quot;ed43257a1fbf2277e895086babfe120a_11b1931e760ece235ce480b385ba4140.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;4.客户端Android&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;安装客户端软件，点击设置-&amp;gt;ID/中级服务器-&amp;gt;输入ID服务器-&amp;gt;点击确认&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/202410081728321563575535.png&quot; alt=&quot;ac40c419667d7b81e406544324138434_124e60653a679893a6681de81c5286cd.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;手机如果只是共享屏幕，点击共享屏幕-&amp;gt;启动服务&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/202410081728321572860365.png&quot; alt=&quot;a3d88d3814894f27142120959e7fc369_b3c8262953bd46fda1cd5dd134d9a486.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp;如果想要远程控制，选择屏幕输入滑块打开，自动提示进入手机设置，到【(手机品牌不同显示内容不一样)无障碍、服务、已安装服务】中找到RustDesk Input，打开此项&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/202410081728321588908097.png&quot; alt=&quot;6ab12a477fd4f84f2762bdb03d170cd7_6d4843d4b75016b1eecc71b42db5067e.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/202410081728321599255262.png&quot; alt=&quot;5443e6320a30c46263e4906650e13f1d_688ae1c805888132042215da104fa788.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp;6.内网穿透&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;如下图，安装完成后，可自行研究&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/202410081728321612788352.png&quot; alt=&quot;8cd7d4f80de1d2876e7ea46716c500a2_005ca4285fcc2ea850e9a01513d9a60a.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;如上述内容有问题，可进行评论。&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 08 Oct 2024 01:17:06 +0800</pubDate></item><item><title>docker部署MongoDB</title><link>http://x.zx.cdqlx.top/?id=28</link><description>&lt;p&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;安装Docker&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; text-wrap: wrap; background-color: rgb(255, 255, 255); line-height: 24px !important;&quot;&gt;(提示：已安装的小伙伴可以忽略此步骤)&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;yum 包更新到最新:&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;0&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;sudo&amp;nbsp;yum&amp;nbsp;-y&amp;nbsp;update&lt;/pre&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;安装需要的软件包， yum-util 提供 yum-config-manager 功能，另外两个是devicemapper 驱动依赖的&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;1&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;sudo&amp;nbsp;yum&amp;nbsp;install&amp;nbsp;-y&amp;nbsp;yum-utils&amp;nbsp;device-mapper-persistent-data&amp;nbsp;lvm2&lt;/pre&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;设置 yum 源为阿里云&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;2&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;sudo&amp;nbsp;yum-config-manager&amp;nbsp;--add-repo&amp;nbsp;http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo&lt;/pre&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;安装&amp;nbsp;&lt;span class=&quot;words-blog hl-git-1&quot; data-tit=&quot;docker&quot; data-pretit=&quot;docker&quot; style=&quot;box-sizing: border-box; outline: 0px; margin: 0px 3px 0px 0px; padding: 0px 18px 0px 0px; font-synthesis-style: auto; overflow-wrap: break-word; cursor: pointer; color: #4EA1DB; background: url(&amp;quot;../img/gitcode-key.png&amp;quot;) right center / 14px 14px no-repeat transparent; box-shadow: none;&quot;&gt;docker&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;3&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;sudo&amp;nbsp;yum&amp;nbsp;install&amp;nbsp;docker-ce&lt;/pre&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;安装后查看 docker 版本&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;4&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;docker&amp;nbsp;-v&lt;/pre&gt;&lt;p&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005442172771528212751.png&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005442172771528234489.jpeg&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;设置镜像加速器&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; text-wrap: wrap; background-color: rgb(255, 255, 255); line-height: 24px !important;&quot;&gt;国内从 DockerHub 拉取镜像有时会遇到困难，此时可以配置镜像加速器。&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;使用阿里云镜像加速器&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;首先进入阿里云的docker库：https://www.aliyun.com/product/&lt;span class=&quot;words-blog hl-git-1&quot; data-tit=&quot;kubernetes&quot; data-pretit=&quot;kubernetes&quot; style=&quot;box-sizing: border-box; outline: 0px; margin: 0px 3px 0px 0px; padding: 0px 18px 0px 0px; font-synthesis-style: auto; overflow-wrap: break-word; cursor: pointer; color: #4EA1DB; background: url(&amp;quot;../img/gitcode-key.png&amp;quot;) right center / 14px 14px no-repeat transparent; box-shadow: none;&quot;&gt;kubernetes&lt;/span&gt;?spm=5176.10695662.1362911.1.3cab795d6uoX0P&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;注册或登录账号，并进入控制台管理&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;选择镜像加速器选项&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005442172771528212751.png&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005443172771528364041.jpeg&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;进入到镜像加速器选项，可以看到你的加速器地址，可以根据操作文档步骤进行配置&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;先创建文件夹，然后编辑文件daemon.json(没有此文件使用touch创建文件)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;5&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;sudo&amp;nbsp;mkdir&amp;nbsp;-p&amp;nbsp;/etc/dockertouch&amp;nbsp;/etc/docker/daemon.jsonvi&amp;nbsp;/etc/docker/daemon.json&lt;/pre&gt;&lt;p&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005442172771528212751.png&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005443172771528319304.jpeg&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;在该文件中输入如下内容,打码的部分为你自己的阿里加速器地址&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;6&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;{&amp;quot;registry-mirrors&amp;quot;:&amp;nbsp;[&amp;quot;https://xxxxx.xxxxx.aliyuncs.com&amp;quot;]}&lt;/pre&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;编辑保存后，需要重启，输入如下命令&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;7&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;sudo&amp;nbsp;systemctl&amp;nbsp;daemon-reload&amp;nbsp;#重启加速器sudo&amp;nbsp;systemctl&amp;nbsp;restart&amp;nbsp;docker&amp;nbsp;#重启docker&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;关闭防火墙&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;8&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;systemctl&amp;nbsp;stop&amp;nbsp;firewalld&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;安装镜像&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;MongoDB 安装&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;9&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;docker&amp;nbsp;pull&amp;nbsp;mongo&lt;/pre&gt;&lt;p&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005442172771528212751.png&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005443172771528344240.jpeg&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;&lt;span class=&quot;words-blog hl-git-1&quot; data-tit=&quot;Redis&quot; data-pretit=&quot;redis&quot; style=&quot;box-sizing: border-box; outline: 0px; margin: 0px 3px 0px 0px; padding: 0px 18px 0px 0px; font-synthesis-style: auto; overflow-wrap: break-word; cursor: pointer; color: #4EA1DB; background: url(&amp;quot;../img/gitcode-key.png&amp;quot;) right center / 14px 14px no-repeat transparent; box-shadow: none;&quot;&gt;Redis&lt;/span&gt;&amp;nbsp;安装&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;10&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;docker&amp;nbsp;pull&amp;nbsp;redis&lt;/pre&gt;&lt;p&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005442172771528212751.png&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005443172771528327427.jpeg&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;拉取 easymock&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;11&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;docker&amp;nbsp;pull&amp;nbsp;blackcater/easy‐mock&lt;/pre&gt;&lt;p&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005442172771528212751.png&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005444172771528490521.jpeg&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;启动 mongo&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;12&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;docker&amp;nbsp;run&amp;nbsp;‐d&amp;nbsp;‐p&amp;nbsp;27017:27017&amp;nbsp;‐v&amp;nbsp;/usr/local/share/mongo/data/:/data&amp;nbsp;‐‐name&amp;nbsp;mongo&amp;nbsp;‐‐restart=always&amp;nbsp;mongo&lt;/pre&gt;&lt;p&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005442172771528212751.png&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005444172771528472870.jpeg&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;进入容器，创建数据库&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;13&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;docker&amp;nbsp;exec&amp;nbsp;‐it&amp;nbsp;mongo&amp;nbsp;bashmongouse&amp;nbsp;easy-mock&lt;/pre&gt;&lt;p&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005442172771528212751.png&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/10/20241001005444172771528425133.jpeg&quot;&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif, SimHei, SimSun; font-size: 16px; text-wrap: wrap; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 18px; color: rgb(77, 77, 77); overflow: auto hidden; font-synthesis-style: auto; overflow-wrap: break-word; line-height: 24px !important;&quot;&gt;启动 redis&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;has set-code-show&quot; data-index=&quot;14&quot; name=&quot;code&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px; position: relative; text-wrap: wrap; overflow-wrap: break-word; overflow: auto hidden; font-family: Consolas, Inconsolata, Courier, monospace; line-height: 22px; max-height: unset; font-synthesis-style: auto; background-color: rgb(255, 255, 255);&quot;&gt;docker&amp;nbsp;run&amp;nbsp;-p&amp;nbsp;6379:6379&amp;nbsp;--name&amp;nbsp;redis&amp;nbsp;-v&amp;nbsp;/home/users/docker/redis/data:/data&amp;nbsp;-d&amp;nbsp;redis&amp;nbsp;redis-server&amp;nbsp;--appendonly&amp;nbsp;yes&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 01 Oct 2024 00:53:27 +0800</pubDate></item><item><title>docker-compose 安装常用docker镜像（kafka、redis、mysql、elasticesarch、zookeeper、mongo）</title><link>http://x.zx.cdqlx.top/?id=27</link><description>&lt;p data-first-child=&quot;&quot; data-pid=&quot;_PdJigag&quot; style=&quot;margin-top: 0px;margin-bottom: 1.4em;color: rgb(25, 27, 31);font-family: -apple-system, BlinkMacSystemFont, &amp;#39;Helvetica Neue&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Source Han Sans SC&amp;#39;, &amp;#39;Noto Sans CJK SC&amp;#39;, &amp;#39;WenQuanYi Micro Hei&amp;#39;, sans-serif;font-size: medium;text-wrap: wrap;background-color: rgb(255, 255, 255)&quot;&gt;Docker Compose是一个用来定义和运行复杂应用的Docker工具。一个使用Docker容器的应用，通常由多个容器组成。使用Docker Compose不再需要使用shell脚本来启动容器。&lt;/p&gt;&lt;p data-pid=&quot;MpqK71r2&quot; style=&quot;margin-top: 1.4em;margin-bottom: 1.4em;color: rgb(25, 27, 31);font-family: -apple-system, BlinkMacSystemFont, &amp;#39;Helvetica Neue&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Source Han Sans SC&amp;#39;, &amp;#39;Noto Sans CJK SC&amp;#39;, &amp;#39;WenQuanYi Micro Hei&amp;#39;, sans-serif;font-size: medium;text-wrap: wrap;background-color: rgb(255, 255, 255)&quot;&gt;Compose 通过一个配置文件来管理多个Docker容器，在配置文件中，所有的容器通过services来定义，然后使用docker-compose脚本来启动，停止和重启应用，和应用中的服务以及所有依赖服务的容器，非常适合组合使用多个容器进行开发的场景。&lt;/p&gt;&lt;h3 style=&quot;font-variant-numeric: inherit;font-variant-east-asian: inherit;font-variant-alternates: inherit;font-variant-position: inherit;font-stretch: inherit;font-size: 1.1em;line-height: 1.5;font-family: -apple-system, BlinkMacSystemFont, &amp;#39;Helvetica Neue&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Source Han Sans SC&amp;#39;, &amp;#39;Noto Sans CJK SC&amp;#39;, &amp;#39;WenQuanYi Micro Hei&amp;#39;, sans-serif;font-optical-sizing: inherit;font-kerning: inherit;font-feature-settings: inherit;font-variation-settings: inherit;margin: calc(1.90909em) 0px calc(1.27273em);clear: left;color: rgb(25, 27, 31);text-wrap: wrap;background-color: rgb(255, 255, 255)&quot;&gt;docker-compose常用命令：&lt;/h3&gt;&lt;p data-pid=&quot;u_woWz8D&quot; style=&quot;margin-top: 1.4em;margin-bottom: 1.4em;color: rgb(25, 27, 31);font-family: -apple-system, BlinkMacSystemFont, &amp;#39;Helvetica Neue&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Source Han Sans SC&amp;#39;, &amp;#39;Noto Sans CJK SC&amp;#39;, &amp;#39;WenQuanYi Micro Hei&amp;#39;, sans-serif;font-size: medium;text-wrap: wrap;background-color: rgb(255, 255, 255)&quot;&gt;在mac或windows系统中，只需要&amp;nbsp;&lt;a href=&quot;https://link.zhihu.com/?target=https%3A//docs.docker.com/desktop/%23download-and-install&quot; class=&quot; wrap external&quot; target=&quot;_blank&quot; rel=&quot;nofollow noreferrer&quot; data-za-detail-view-id=&quot;1043&quot; style=&quot;;border-bottom: 1px solid rgb(129, 133, 143);cursor: pointer&quot;&gt;下载Docker Desktop&lt;/a&gt;&amp;nbsp;应用，即可直接使用docker-compose脚本&lt;/p&gt;&lt;p data-pid=&quot;VB2LEkrH&quot; style=&quot;margin-top: 1.4em;margin-bottom: 1.4em;color: rgb(25, 27, 31);font-family: -apple-system, BlinkMacSystemFont, &amp;#39;Helvetica Neue&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Source Han Sans SC&amp;#39;, &amp;#39;Noto Sans CJK SC&amp;#39;, &amp;#39;WenQuanYi Micro Hei&amp;#39;, sans-serif;font-size: medium;text-wrap: wrap;background-color: rgb(255, 255, 255)&quot;&gt;在Linux系统中，安装docker-compose的步骤如下&lt;/p&gt;&lt;ol style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;先&amp;nbsp;&lt;a href=&quot;https://link.zhihu.com/?target=https%3A//docs.docker.com/engine/install/%23server&quot; class=&quot; wrap external&quot; target=&quot;_blank&quot; rel=&quot;nofollow noreferrer&quot; data-za-detail-view-id=&quot;1043&quot; style=&quot;;border-bottom: 1px solid rgb(129, 133, 143);cursor: pointer&quot;&gt;安装docker&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;下载二进制文件（似乎需要与当前安装的docker大版本匹配，从1.29.1开始支持depend_on，建议使用2.0.1版本）：&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre style=&quot;margin-top: 0px;margin-bottom: 0px;overflow-wrap: initial;background-color: rgb(248, 248, 250);border-radius: 4px;font-size: 0.9em;overflow: auto;padding: calc(0.888889em)&quot;&gt;curl&amp;nbsp;-L&amp;nbsp;&amp;quot;https://get.daocloud.io/docker/compose/releases/download/1.29.1/docker-compose-`uname&amp;nbsp;-s`-`uname&amp;nbsp;-m`&amp;quot;&amp;nbsp;&amp;gt;&amp;nbsp;/usr/local/bin/docker-compose&lt;/pre&gt;&lt;p data-pid=&quot;_IulPtFG&quot; style=&quot;margin-top: 1.4em;margin-bottom: 1.4em;color: rgb(25, 27, 31);font-family: -apple-system, BlinkMacSystemFont, &amp;#39;Helvetica Neue&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Source Han Sans SC&amp;#39;, &amp;#39;Noto Sans CJK SC&amp;#39;, &amp;#39;WenQuanYi Micro Hei&amp;#39;, sans-serif;font-size: medium;text-wrap: wrap;background-color: rgb(255, 255, 255)&quot;&gt;3. 授权：&lt;code style=&quot;background-color: rgb(248, 248, 250);border-radius: 3px;font-family: Menlo, Monaco, Consolas, &amp;#39;Andale Mono&amp;#39;, &amp;#39;lucida console&amp;#39;, &amp;#39;Courier New&amp;#39;, monospace;font-size: 0.9em;margin: 0px 2px;padding: 3px 4px&quot;&gt;sudo chmod +x /usr/local/bin/docker-compose&lt;/code&gt;&lt;/p&gt;&lt;p data-pid=&quot;xiLw1uHu&quot; style=&quot;margin-top: 1.4em;margin-bottom: 1.4em;color: rgb(25, 27, 31);font-family: -apple-system, BlinkMacSystemFont, &amp;#39;Helvetica Neue&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Source Han Sans SC&amp;#39;, &amp;#39;Noto Sans CJK SC&amp;#39;, &amp;#39;WenQuanYi Micro Hei&amp;#39;, sans-serif;font-size: medium;text-wrap: wrap;background-color: rgb(255, 255, 255)&quot;&gt;4. 选做，创建一个软链接：sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose&lt;/p&gt;&lt;h3 style=&quot;font-variant-numeric: inherit;font-variant-east-asian: inherit;font-variant-alternates: inherit;font-variant-position: inherit;font-stretch: inherit;font-size: 1.1em;line-height: 1.5;font-family: -apple-system, BlinkMacSystemFont, &amp;#39;Helvetica Neue&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Source Han Sans SC&amp;#39;, &amp;#39;Noto Sans CJK SC&amp;#39;, &amp;#39;WenQuanYi Micro Hei&amp;#39;, sans-serif;font-optical-sizing: inherit;font-kerning: inherit;font-feature-settings: inherit;font-variation-settings: inherit;margin: calc(1.90909em) 0px calc(1.27273em);clear: left;color: rgb(25, 27, 31);text-wrap: wrap;background-color: rgb(255, 255, 255)&quot;&gt;docker-compose常用命令：&lt;/h3&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;查看docker-compose版本（确认是否安装）：&lt;a class=&quot;RichContent-EntityWord css-b7erz1&quot; data-za-not-track-link=&quot;true&quot; data-paste-text=&quot;true&quot; href=&quot;https://zhida.zhihu.com/search?content_id=190349736&amp;content_type=Article&amp;match_order=1&amp;q=docker-compose+version&amp;zhida_source=entity&quot; target=&quot;_blank&quot; style=&quot;;color: rgb(9, 64, 142);cursor: pointer&quot;&gt;docker-compose version&lt;svg width=&quot;10px&quot; height=&quot;10px&quot; viewbox=&quot;0 0 16 16&quot; class=&quot;ZDI ZDI--FourPointedStar16 css-1dvsrp&quot; fill=&quot;currentColor&quot;&gt;&lt;path d=&quot;m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;拉取docker-compose.yml文件中使用到的images：&lt;a class=&quot;RichContent-EntityWord css-b7erz1&quot; data-za-not-track-link=&quot;true&quot; data-paste-text=&quot;true&quot; href=&quot;https://zhida.zhihu.com/search?content_id=190349736&amp;content_type=Article&amp;match_order=1&amp;q=docker-compose+pull&amp;zhida_source=entity&quot; target=&quot;_blank&quot; style=&quot;;color: rgb(9, 64, 142);cursor: pointer&quot;&gt;docker-compose pull&lt;svg width=&quot;10px&quot; height=&quot;10px&quot; viewbox=&quot;0 0 16 16&quot; class=&quot;ZDI ZDI--FourPointedStar16 css-1dvsrp&quot; fill=&quot;currentColor&quot;&gt;&lt;path d=&quot;m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style=&quot;font-weight: 600&quot;&gt;部署docker-compose服务：docker-compose [ -f docker-compose.yml ] [ -p dev ] up [ -d ] [ kafka mysql redis es kibana ]&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;ul style=&quot;list-style-type: circle;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;-f 指定docker-compose要使用的配置文件，不指定时默认使用docker-compose.yml&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;-p 指定项目名称（project_name）&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;-d 指定应用在后台启动&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;最后的可选值，如果不指定，则启动配置文件中的所有service；如果指定了service名称，则只启动指定的service（如果此service需要依赖其他service，则被依赖的service也会启动）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;p&gt;重启已停止的 Compose 应用：docker-compose restart&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;停止 Compose 应用相关的所有容器（不删除）：docker-compose stop&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;删除已停止的 Compose 应用：docker-compose rm&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;列出 Compose 应用中的各个容器：docker-compose ps&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;停止并删除运行中的 Compose 应用：&lt;a class=&quot;RichContent-EntityWord css-b7erz1&quot; data-za-not-track-link=&quot;true&quot; data-paste-text=&quot;true&quot; href=&quot;https://zhida.zhihu.com/search?content_id=190349736&amp;content_type=Article&amp;match_order=1&amp;q=docker-compose+down&amp;zhida_source=entity&quot; target=&quot;_blank&quot; style=&quot;;color: rgb(9, 64, 142);cursor: pointer&quot;&gt;docker-compose down&lt;svg width=&quot;10px&quot; height=&quot;10px&quot; viewbox=&quot;0 0 16 16&quot; class=&quot;ZDI ZDI--FourPointedStar16 css-1dvsrp&quot; fill=&quot;currentColor&quot;&gt;&lt;path d=&quot;m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;font-variant-numeric: inherit;font-variant-east-asian: inherit;font-variant-alternates: inherit;font-variant-position: inherit;font-stretch: inherit;font-size: 1.1em;line-height: 1.5;font-family: -apple-system, BlinkMacSystemFont, &amp;#39;Helvetica Neue&amp;#39;, &amp;#39;PingFang SC&amp;#39;, &amp;#39;Microsoft YaHei&amp;#39;, &amp;#39;Source Han Sans SC&amp;#39;, &amp;#39;Noto Sans CJK SC&amp;#39;, &amp;#39;WenQuanYi Micro Hei&amp;#39;, sans-serif;font-optical-sizing: inherit;font-kerning: inherit;font-feature-settings: inherit;font-variation-settings: inherit;margin: calc(1.90909em) 0px calc(1.27273em);clear: left;color: rgb(25, 27, 31);text-wrap: wrap;background-color: rgb(255, 255, 255)&quot;&gt;注意事项：&lt;/h3&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;如果容器挂载了外部文件夹，则需要先创建文件夹，否则报错&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;低版本（1.*版本）要使用&lt;code style=&quot;background-color: rgb(248, 248, 250);border-radius: 3px;font-family: Menlo, Monaco, Consolas, &amp;#39;Andale Mono&amp;#39;, &amp;#39;lucida console&amp;#39;, &amp;#39;Courier New&amp;#39;, monospace;font-size: 0.9em;margin: 0px 2px;padding: 3px 4px&quot;&gt;docker-compose&lt;/code&gt;命令，桌面版docker高版本（docker-compose 2.*）可以使用&lt;code style=&quot;background-color: rgb(248, 248, 250);border-radius: 3px;font-family: Menlo, Monaco, Consolas, &amp;#39;Andale Mono&amp;#39;, &amp;#39;lucida console&amp;#39;, &amp;#39;Courier New&amp;#39;, monospace;font-size: 0.9em;margin: 0px 2px;padding: 3px 4px&quot;&gt;docker compose&lt;/code&gt;命令&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;关于`docker-compose.yml`文件中version与docker版本的对应关系，见&amp;nbsp;&lt;a href=&quot;https://link.zhihu.com/?target=https%3A//docs.docker.com/compose/compose-file/%23compose-and-docker-compatibility-matrix&quot; class=&quot; wrap external&quot; target=&quot;_blank&quot; rel=&quot;nofollow noreferrer&quot; data-za-detail-view-id=&quot;1043&quot; style=&quot;;border-bottom: 1px solid rgb(129, 133, 143);cursor: pointer&quot;&gt;Compose-file&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;注意`docker-compose.yml`文件中双引号的使用！&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;h3 style=&quot;font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-stretch: inherit; font-size: 1.1em; line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-optical-sizing: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; margin: calc(1.90909em) 0px calc(1.27273em); clear: left; color: rgb(25, 27, 31); text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;docker-compose.yml文件&lt;/h3&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre style=&quot;margin-top: 0px;margin-bottom: 0px;overflow-wrap: initial;background-color: rgb(248, 248, 250);border-radius: 4px;font-size: 0.9em;overflow: auto;padding: calc(0.888889em)&quot;&gt;#&amp;nbsp;docker&amp;nbsp;compose&amp;nbsp;commands&amp;nbsp;--&amp;gt;&amp;nbsp;#&amp;nbsp;后台启动配置文件中的所有服务：&amp;nbsp;#&amp;nbsp;docker&amp;nbsp;compose&amp;nbsp;-f&amp;nbsp;docker-compose.yml&amp;nbsp;-p&amp;nbsp;dev&amp;nbsp;up&amp;nbsp;-d&amp;nbsp;#&amp;nbsp;后台启动一部分服务&amp;nbsp;#&amp;nbsp;docker&amp;nbsp;compose&amp;nbsp;-f&amp;nbsp;docker-compose.yml&amp;nbsp;-p&amp;nbsp;dev&amp;nbsp;up&amp;nbsp;-d&amp;nbsp;&amp;nbsp;kafka&amp;nbsp;mysql&amp;nbsp;redis&amp;nbsp;es&amp;nbsp;kibana&amp;nbsp;#&amp;nbsp;关闭所有服务&amp;nbsp;#&amp;nbsp;docker&amp;nbsp;compose&amp;nbsp;down&amp;nbsp;&amp;nbsp;version:&amp;nbsp;&amp;#39;3&amp;#39;&amp;nbsp;&amp;nbsp;services:&amp;nbsp;&amp;nbsp;&amp;nbsp;kafka:&amp;nbsp;&amp;nbsp;image:&amp;nbsp;wurstmeister/kafka:2.12-2.4.1&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;kafka&amp;nbsp;&amp;nbsp;#&amp;nbsp;依赖其他服务时，docker会先启动其他服务，注意service名称的对应&amp;nbsp;&amp;nbsp;depends_on:&amp;nbsp;[&amp;nbsp;zookeeper&amp;nbsp;]&amp;nbsp;&amp;nbsp;#&amp;nbsp;重启策略：在什么情况下服务会重启，可选值有no、always、on-failure、unless-stopped&amp;nbsp;&amp;nbsp;restart:&amp;nbsp;&amp;quot;no&amp;quot;&amp;nbsp;&amp;nbsp;#&amp;nbsp;&amp;nbsp;宿主机端口号到容器端口号的映射&amp;nbsp;&amp;nbsp;ports:&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;9092:9092&amp;quot;&amp;nbsp;&amp;nbsp;#&amp;nbsp;观景变量的配置，注意引号的使用，也可以使用另一种形式配置（冒号后有空格，且没有最前面的”-“）&amp;nbsp;variable:&amp;nbsp;123&amp;nbsp;&amp;nbsp;environment:&amp;nbsp;&amp;nbsp;#&amp;nbsp;如果需要允许其他客户端访问，可能需要将这里的ip改为自己宿主机实际使用的ip地址，如&amp;nbsp;192.168.2.236&amp;nbsp;&amp;nbsp;-&amp;nbsp;KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://192.168.11.91:9092&amp;nbsp;&amp;nbsp;#&amp;nbsp;-&amp;nbsp;KAFKA_ADVERTISED_HOST_NAME=127.0.0.1&amp;nbsp;&amp;nbsp;-&amp;nbsp;KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092&amp;nbsp;&amp;nbsp;-&amp;nbsp;KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181&amp;nbsp;&amp;nbsp;-&amp;nbsp;KAFKA_HEAP_OPTS=&amp;quot;-Xms200m&amp;nbsp;-Xmx512M&amp;quot;&amp;nbsp;&amp;nbsp;-&amp;nbsp;KAFKA_AUTO_CREATE_TOPICS_ENABLE=true&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;KAFKA_BROKER_ID=0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;KAFKA_LOG_DIRS=&amp;quot;/kafka/kafka-logs-1&amp;quot;&amp;nbsp;&amp;nbsp;#&amp;nbsp;volumes:&amp;nbsp;&amp;nbsp;#&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;/usr/local/kafka/logs:/kafka/kafka-logs-1&amp;nbsp;&amp;nbsp;&amp;nbsp;zookeeper:&amp;nbsp;&amp;nbsp;image:&amp;nbsp;zookeeper:3.5.9&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;zookeeper&amp;nbsp;&amp;nbsp;restart:&amp;nbsp;on-failure&amp;nbsp;&amp;nbsp;ports:&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;2181:2181&amp;quot;&amp;nbsp;&amp;nbsp;#&amp;nbsp;volumes:&amp;nbsp;&amp;nbsp;#&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;/usr/local/zookeeper/data:/data&amp;nbsp;&amp;nbsp;#&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;/usr/local/zookeeper/log:/datalog&amp;nbsp;&amp;nbsp;#&amp;nbsp;---------------------------------------------------------&amp;nbsp;&amp;nbsp;mysql:&amp;nbsp;&amp;nbsp;image:&amp;nbsp;mysql:5.7.33&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;mysql&amp;nbsp;&amp;nbsp;ports:&amp;nbsp;&amp;nbsp;#&amp;nbsp;宿主机的端口：容器的端口&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;3306:3306&amp;quot;&amp;nbsp;&amp;nbsp;#让容器拥有root权&amp;nbsp;&amp;nbsp;privileged:&amp;nbsp;true&amp;nbsp;&amp;nbsp;command:&amp;nbsp;&amp;nbsp;--explicit_defaults_for_timestamp=true&amp;nbsp;&amp;nbsp;--lower_case_table_names=1&amp;nbsp;&amp;nbsp;--default-authentication-plugin=mysql_native_password&amp;nbsp;#这行代码解决无法访问的问题&amp;nbsp;&amp;nbsp;#&amp;nbsp;ALTER&amp;nbsp;USER&amp;#39;root&amp;#39;@&amp;#39;%&amp;#39;&amp;nbsp;IDENTIFIED&amp;nbsp;WITH&amp;nbsp;mysql_native_password&amp;nbsp;BY&amp;nbsp;&amp;#39;123456&amp;#39;;&amp;nbsp;&amp;nbsp;&amp;nbsp;environment:&amp;nbsp;&amp;nbsp;-&amp;nbsp;MYSQL_ROOT_PASSWORD=123456&amp;nbsp;&amp;nbsp;#&amp;nbsp;-&amp;nbsp;MYSQL_USER=mysql&amp;nbsp;&amp;nbsp;#&amp;nbsp;-&amp;nbsp;MYSQL_PASS=123456&amp;nbsp;&amp;nbsp;volumes:&amp;nbsp;&amp;nbsp;-&amp;nbsp;~/mysql_data:/var/lib/mysql&amp;nbsp;&amp;nbsp;#&amp;nbsp;---------------------------------------------------------&amp;nbsp;&amp;nbsp;redis:&amp;nbsp;&amp;nbsp;image:&amp;nbsp;redis:6.2.1&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;redis&amp;nbsp;&amp;nbsp;ports:&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;6379:6379&amp;quot;&amp;nbsp;&amp;nbsp;deploy:&amp;nbsp;&amp;nbsp;resources:&amp;nbsp;&amp;nbsp;limits:&amp;nbsp;&amp;nbsp;cpus:&amp;nbsp;&amp;#39;0.50&amp;#39;&amp;nbsp;&amp;nbsp;memory:&amp;nbsp;500M&amp;nbsp;&amp;nbsp;environment:&amp;nbsp;&amp;nbsp;-&amp;nbsp;TZ=Asia/Shanghai&amp;nbsp;&amp;nbsp;-&amp;nbsp;LANG=en_US.UTF-8&amp;nbsp;&amp;nbsp;#&amp;nbsp;---------------------------------------------------------&amp;nbsp;&amp;nbsp;mongo:&amp;nbsp;&amp;nbsp;image:&amp;nbsp;mongo:4.4.9&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;mongo&amp;nbsp;&amp;nbsp;ports:&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;27017:27017&amp;quot;&amp;nbsp;&amp;nbsp;environment:&amp;nbsp;&amp;nbsp;-&amp;nbsp;MONGO_INITDB_ROOT_USERNAME=admin&amp;nbsp;&amp;nbsp;-&amp;nbsp;MONGO_INITDB_ROOT_PASSWORD=123456&amp;nbsp;&amp;nbsp;-&amp;nbsp;TZ=Asia/Shanghai&amp;nbsp;&amp;nbsp;#&amp;nbsp;---------------------------------------------------------&amp;nbsp;&amp;nbsp;es:&amp;nbsp;&amp;nbsp;image:&amp;nbsp;elasticsearch:7.11.2&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;es&amp;nbsp;&amp;nbsp;ports:&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;9200:9200&amp;quot;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;9300:9300&amp;quot;&amp;nbsp;&amp;nbsp;environment:&amp;nbsp;&amp;nbsp;-&amp;nbsp;ES_JAVA_OPTS=-Xms128m&amp;nbsp;-Xmx1024m&amp;nbsp;&amp;nbsp;-&amp;nbsp;cluster.name=elasticsearch&amp;nbsp;&amp;nbsp;-&amp;nbsp;discovery.type=single-node&amp;nbsp;&amp;nbsp;-&amp;nbsp;bootstrap.memory_lock=true&amp;nbsp;&amp;nbsp;-&amp;nbsp;http.cors.enabled=true&amp;nbsp;&amp;nbsp;-&amp;nbsp;http.cors.allow-origin=*&amp;nbsp;&amp;nbsp;-&amp;nbsp;TZ=Asia/Shanghai&amp;nbsp;&amp;nbsp;ulimits:&amp;nbsp;&amp;nbsp;memlock:&amp;nbsp;&amp;nbsp;soft:&amp;nbsp;-1&amp;nbsp;&amp;nbsp;hard:&amp;nbsp;-1&amp;nbsp;&amp;nbsp;&amp;nbsp;kibana:&amp;nbsp;&amp;nbsp;image:&amp;nbsp;kibana:6.8.20&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;kibana&amp;nbsp;&amp;nbsp;ports:&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;quot;5601:5601&amp;quot;&amp;nbsp;&amp;nbsp;depends_on:&amp;nbsp;[&amp;nbsp;es&amp;nbsp;]&amp;nbsp;&amp;nbsp;environment:&amp;nbsp;&amp;nbsp;-&amp;nbsp;ELASTICSEARCH_URL=http://192.168.11.91:9200&amp;nbsp;&amp;nbsp;#&amp;nbsp;---------------------------------------------------------&amp;nbsp;&amp;nbsp;eureka:&amp;nbsp;&amp;nbsp;image:&amp;nbsp;eureka:local&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;eureka&amp;nbsp;&amp;nbsp;ports:&amp;nbsp;&amp;nbsp;-&amp;nbsp;8761:8761&amp;nbsp;&amp;nbsp;environment:&amp;nbsp;&amp;nbsp;PORT:&amp;nbsp;&amp;quot;8761&amp;quot;&amp;nbsp;&amp;nbsp;SPRING_PROFILES_ACTIVE:&amp;nbsp;dev&amp;nbsp;&amp;nbsp;#&amp;nbsp;---------------------------------------------------------&amp;nbsp;&amp;nbsp;hbase-master:&amp;nbsp;&amp;nbsp;image:&amp;nbsp;bde2020/hbase-master:1.0.0-hbase1.2.6&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;hbase-master&amp;nbsp;&amp;nbsp;hostname:&amp;nbsp;hbase-master&amp;nbsp;&amp;nbsp;env_file:&amp;nbsp;&amp;nbsp;-&amp;nbsp;~/hbase-distributed-local.env&amp;nbsp;&amp;nbsp;environment:&amp;nbsp;&amp;nbsp;SERVICE_PRECONDITION:&amp;nbsp;&amp;quot;namenode:50070&amp;nbsp;datanode:50075&amp;nbsp;zookeeper:2181&amp;quot;&amp;nbsp;&amp;nbsp;ports:&amp;nbsp;&amp;nbsp;-&amp;nbsp;16010:16010&amp;nbsp;&amp;nbsp;-&amp;nbsp;16000:16000&amp;nbsp;#&amp;nbsp;新添加&amp;nbsp;&amp;nbsp;&amp;nbsp;hbase-region:&amp;nbsp;&amp;nbsp;image:&amp;nbsp;bde2020/hbase-regionserver:1.0.0-hbase1.2.6&amp;nbsp;&amp;nbsp;container_name:&amp;nbsp;hbase-regionserver&amp;nbsp;&amp;nbsp;hostname:&amp;nbsp;hbase-regionserver&amp;nbsp;&amp;nbsp;env_file:&amp;nbsp;&amp;nbsp;-&amp;nbsp;~/hbase-distributed-local.env&amp;nbsp;&amp;nbsp;environment:&amp;nbsp;&amp;nbsp;HBASE_CONF_hbase_regionserver_hostname:&amp;nbsp;hbase-region&amp;nbsp;&amp;nbsp;SERVICE_PRECONDITION:&amp;nbsp;&amp;quot;namenode:50070&amp;nbsp;datanode:50075&amp;nbsp;zookeeper:2181&amp;nbsp;hbase-master:16010&amp;quot;&amp;nbsp;&amp;nbsp;ports:&amp;nbsp;&amp;nbsp;-&amp;nbsp;16030:16030&amp;nbsp;&amp;nbsp;-&amp;nbsp;16020:16020&amp;nbsp;#&amp;nbsp;新添加&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Mon, 30 Sep 2024 17:25:00 +0800</pubDate></item><item><title>正经分析iOS包大小优化</title><link>http://x.zx.cdqlx.top/?id=26</link><description>&lt;h3 id=&quot;b4l0h&quot; name=&quot;%E8%83%8C%E6%99%AF&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px 8px; padding: 0px; font-size: 16px; box-sizing: border-box; list-style: inherit; line-height: 26px; font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;背景&lt;/h3&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;包大小优化是项目开发中不可避免会遇到的，网上关于包大小优化的文章很多，每篇文章说的都不尽相同，笔者曾经根据网上的文章做过包大小优化，但效果不尽人意；因此笔者想根据已有的文章、知识结合自己的理解、实践，做一份总结梳理，整理自己的包大小优化逻辑，不光要知道怎么做可以让包大小变化，还要知道为什么这么做能产生效果，所以就有了这篇文章。&lt;/p&gt;&lt;h3 id=&quot;arkko&quot; name=&quot;%E5%88%86%E6%9E%90&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px 8px; padding: 0px; font-size: 16px; box-sizing: border-box; list-style: inherit; line-height: 26px; font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;分析&lt;/h3&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;想要优化安装包大小，首先需要弄清楚影响安装包大小的因素有哪些？之前笔者优化包大小直接闷着头就去瘦身，瘦来瘦去也没瘦出个名堂，而且还跟别人说不清楚自己做了什么，为什么这么做？&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;后来总结出来，做事之前要先思考、分析、最后再去做，要思考的是影响这件事的因素有哪些，一一列举出来，查漏补缺；然后针对这些因素进行分析，分析哪些因素是人为可控的，哪些因素是不能改变的，针对可控的部分要怎么优化，不可控的部分是否能避免，最好可以使用思维导图工具，一一记录；然后按照思维导图的整理出来的数据，按步骤去执行。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;回过头来，针对安装包大小，首先分析影响安装包大小的因素，有：&lt;span class=&quot;mod-overview__keyword&quot; style=&quot;overflow-wrap: break-word; margin: 0px 4px; cursor: pointer; color: #0052D9; padding-right: 10px; background-image: url(&amp;quot;images/icon-keyword_32a.svg&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;Xcode&lt;/span&gt;的设置、资源、代码三个方面。那针对这几个方面要怎么优化？以及如何查看每一步优化的结果？&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;首先是怎么优化的问题：&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;Xcode的编译设置优化，Xcode设置影响的是生成包的大小，通过Xcode编译选项优化的设置，让生成的ipa包变小，比如不含断点调试、去掉异常支持等等。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;资源文件的优化，资源不光有图片资源，也包含代码资源和其它导入的资源，可以通过分析安装包构成，看里面哪些部分比较大、不合理，从而进行优化。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;代码的优化，通过Link Map生成Link Map File，分析Link Map File各文件占用，结合Mach-O文件进行分析优化。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;然后是怎么查看每一步优化的结果的问题：&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;查看每一步的优化结果，可以通过分析打包出来的ipa的大小，以及ipa的组成，与初始的ipa包大小比较，即可直观得到优化的结果。但可以更进一步，分析ipa的构成，对比优化后的构成，看每一步的操作具体影响的是包的哪一块儿，从而导致包的大小发生了变化。所以先来看一下一个ipa的包包含哪些内容，然后每一步优化之后，对应ipa的哪一部分发生了变化？&lt;/p&gt;&lt;h4 id=&quot;216t5&quot; name=&quot;%E5%AE%89%E8%A3%85%E5%8C%85%E7%9A%84%E6%9E%84%E6%88%90&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px 8px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 24px; font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;安装包的构成&lt;/h4&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span class=&quot;mod-overview__keyword&quot; style=&quot;overflow-wrap: break-word; margin: 0px 4px; cursor: pointer; color: #0052D9; padding-right: 10px; background-image: url(&amp;quot;images/icon-keyword_32a.svg&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;iOS&lt;/span&gt;打包出来的ipa，本质上是一个压缩包，所以可以将.ipa的后缀改为.zip，然后进行解压缩，之后会得到一个Payload文件夹，里面又一个xxx.app的文件，这个xxx.app就是包含所有文件的包了，选中xxx.app，右键显示包内容，即可看到里面具体包含的东西了，大致如下：&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;安装包：&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;_CodeSignature： &amp;nbsp;ipa包签名文件&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;.lproj： &amp;nbsp; &amp;nbsp; &amp;nbsp;语言文件&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Frameworks： &amp;nbsp; &amp;nbsp; &amp;nbsp;第三库、SwiftSupport库&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Plugins： &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; App创建的扩展，比如：Widget、Push、分享&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Assets.car： &amp;nbsp; &amp;nbsp; &amp;nbsp;由Assets.xcassets生成的资源文件，里面包含各种分辨率的图片&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;embedded.mobileprovision：证书配置文件&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Info.plist： &amp;nbsp; &amp;nbsp; &amp;nbsp;项目配置&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;exec格式的xxx： &amp;nbsp; &amp;nbsp;可执行包&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;其它资源文件&lt;/p&gt;&lt;/li&gt;&lt;ul class=&quot;ul-level-1 list-paddingleft-2&quot; style=&quot;list-style-type: circle;&quot;&gt;&lt;li&gt;&lt;p&gt;.mp3格式的文件&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;.html的文件&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;.json的文件&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;.png或者.jpg的文件&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;示例如下，Ps：不得不说，笔者这个ipa包含的内容真的是很全面了，各种的资源都有，哈哈哈&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&amp;lt;img src=&amp;quot;https://i.loli.net/2021/04/30/ziwFcNfbSe7yKQu.png&amp;quot; width=&amp;quot;50%&amp;quot; height=&amp;quot;50%&amp;quot;&amp;gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;笔者初始ipa包大小为22.9M，解压缩之后.app的大小为57.1M，其中各部分大小明细如下&lt;/p&gt;&lt;div class=&quot;table-wrapper&quot; style=&quot;overflow-wrap: break-word; margin: 12px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; outline: none; position: relative; overflow-x: auto; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;table width=&quot;996&quot;&gt;&lt;thead style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;内容&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;大小&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;_CodeSignature&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;93 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;.lproj&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;4 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Frameworks&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;37.5 MB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Plugins&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;181 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Assets.car&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;4.9M&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;embedded.mobileprovision&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;8KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Info.plist&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;6 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;exec格式的xxx&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;13 MB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;其它资源文件&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;1.4 MB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;了解了iPa包的组成之后，我们再回过头来，按照Xcode的编译优化、资源文件优化、代码优化的步骤来一步步分析。&lt;/p&gt;&lt;h4 id=&quot;19osc&quot; name=&quot;Xcode%E7%BC%96%E8%AF%91%E8%AE%BE%E7%BD%AE&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px 8px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 24px; font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;Xcode编译设置&lt;/h4&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;一般这一步容易被人忽略，因为提到优化最先能想到的就是资源优化，比如&lt;a href=&quot;https://cloud.tencent.com/product/ip?from_column=20065&amp;from=20065&quot; target=&quot;_blank&quot; class=&quot;rno-markdown__textlink-new&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; padding: 0px 10px 0px 0px; margin: 0px 4px; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217); cursor: pointer; background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiIGZpbGw9Im5vbmUiPjxwYXRoIGQ9Ik00LjMwMyA1LjAxbC0uNzA3LjcwN2ExLjUgMS41IDAgMDEtMi4xMjEtMi4xMjFsLjcwNy0uNzA3LS43MDctLjcwNy0uNzA3LjcwN2EyLjUgMi41IDAgMTAzLjUzNSAzLjUzNWwuNzA4LS43MDctLjcwOC0uNzA3ek01LjAxIDQuMzAzbC43MDguNzA3LjcwNy0uNzA3QTIuNSAyLjUgMCAwMDIuODg5Ljc2N2wtLjcwNy43MDcuNzA3LjcwOC43MDctLjcwOGExLjUgMS41IDAgMDEyLjEyMiAyLjEyMmwtLjcwNy43MDd6IiBmaWxsPSIjMDA1MkQ5Ii8+PHBhdGggZD0iTTQuMzAzIDIuMTgybC43MDguNzA3LTIuMTIyIDIuMTItLjcwNy0uNzA2IDIuMTIxLTIuMTIxeiIgZmlsbD0iIzAwNTJEOSIvPjwvc3ZnPg==&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none;&quot;&gt;图片压缩&lt;/a&gt;、无用代码删除等等，而对于Xcode自身的编译优化提及的反而不多。而且由于网上提供的参考针对每个项目可能结果都不一样，有些编译选项的设置是需要针与实际项目结合起来才可以，所以笔者这里整理和总结了一下：&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;Xcode编译优化相关：&lt;/p&gt;&lt;ol class=&quot;ol-level-0 list-paddingleft-2&quot; style=&quot;overflow-wrap: break-word; margin-bottom: 16px; padding: 0px 0px 0px 6px; box-sizing: border-box; list-style-position: inside; list-style-image: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;li&gt;&lt;p&gt;Build Settings中去掉异常支持，Enable C++ Exceptions和Enable &lt;span class=&quot;mod-overview__keyword&quot; style=&quot;overflow-wrap: break-word; margin: 0px 4px; cursor: pointer; color: #0052D9; padding-right: 10px; background-image: url(&amp;quot;images/icon-keyword_32a.svg&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none; box-sizing: border-box; list-style: inherit;&quot;&gt;Objective-C&lt;/span&gt; Exceptions设置为NO，Other C Flags添加-fno-exceptions；&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 806.75px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 806.75px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233402172727844277096.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WeCom20210430-150019.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 880.453px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 880.453px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233403172727844376442.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WeCom20210430-150116.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;注意：Enable C++ Excptions和Enable Objective-C Exceptions是指项目支持对错误的异常处理，比如try catch、throw之类的；所以如果项目中使用的有类似的异常处理的，这个关闭了之后会报错（Cannot use &amp;#39;@try&amp;#39; with Objective-C exceptions disabled）。包括宏定义中使用的有try{}、@finally{}之类的，比如@strongify等，如果关闭了最后打包的时候也会报错。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;-fno-exceptions的意思是禁用异常机制，参考&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=http%3A%2F%2Fgcc.gnu.org%2Fonlinedocs%2Fgcc-4.7.0%2Flibstdc%2B%2B%2Fmanual%2Fmanual%2Fusing_exceptions.html&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;gcc&lt;/a&gt;，同样，当项目中有try thorw的时候，就不要设置这个选项为NO&lt;/p&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;gt;&amp;nbsp;Before&amp;nbsp;detailing&amp;nbsp;the&amp;nbsp;library&amp;nbsp;support&amp;nbsp;for&amp;nbsp;-fno-exceptions,&amp;nbsp;first&amp;nbsp;a&amp;nbsp;passing&amp;nbsp;note&amp;nbsp;on&amp;nbsp;the&amp;nbsp;things&amp;nbsp;lost&amp;nbsp;when&amp;nbsp;this&amp;nbsp;flag&amp;nbsp;is&amp;nbsp;used:&amp;nbsp;it&amp;nbsp;will&amp;nbsp;break&amp;nbsp;exceptions&amp;nbsp;trying&amp;nbsp;to&amp;nbsp;pass&amp;nbsp;through&amp;nbsp;code&amp;nbsp;compiled&amp;nbsp;with&amp;nbsp;-fno-exceptions&amp;nbsp;whether&amp;nbsp;or&amp;nbsp;not&amp;nbsp;that&amp;nbsp;code&amp;nbsp;has&amp;nbsp;any&amp;nbsp;try&amp;nbsp;or&amp;nbsp;catch&amp;nbsp;constructs.&amp;nbsp;If&amp;nbsp;you&amp;nbsp;might&amp;nbsp;have&amp;nbsp;some&amp;nbsp;code&amp;nbsp;that&amp;nbsp;throws,&amp;nbsp;you&amp;nbsp;shouldn&amp;#39;t&amp;nbsp;use&amp;nbsp;-fno-exceptions.&amp;nbsp;If&amp;nbsp;you&amp;nbsp;have&amp;nbsp;some&amp;nbsp;code&amp;nbsp;that&amp;nbsp;uses&amp;nbsp;try&amp;nbsp;or&amp;nbsp;catch,&amp;nbsp;you&amp;nbsp;shouldn&amp;#39;t&amp;nbsp;use&amp;nbsp;-fno-exceptions.&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;ol-level-0 list-paddingleft-2&quot; style=&quot;overflow-wrap: break-word; margin-bottom: 16px; padding: 0px 0px 0px 6px; box-sizing: border-box; list-style-position: inside; list-style-image: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;li&gt;&lt;p&gt;Build Settings -&amp;gt; Architectures，Release下设置为arm64&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 996px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 996px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233403172727844319244.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WeCom20210430-170718@2x.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;Architectures指定工程被编译成可支持哪些指令集类型，支持的指令集越多，就会编译出多个指令集代码的数据包，ipa包就会变大。默认的standard architectures(armv7,arm64) 参数，打的包里面有32位、64位两份指令集。如果不需要32位的，可以在other中更改支持的指令集，从而使ipa包变小。&lt;/p&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;gt;&amp;nbsp;armv6:&amp;nbsp;iPhone,&amp;nbsp;iPhone&amp;nbsp;3G,&amp;nbsp;iPod&amp;nbsp;1G/2G&amp;nbsp;&amp;nbsp;
&amp;gt;&amp;nbsp;armv7:&amp;nbsp;iPhone&amp;nbsp;3GS,&amp;nbsp;iPhone&amp;nbsp;4,&amp;nbsp;iPhone&amp;nbsp;4S,&amp;nbsp;iPod&amp;nbsp;3G/4G/5G,&amp;nbsp;iPad,&amp;nbsp;iPad&amp;nbsp;2,&amp;nbsp;iPad&amp;nbsp;3,&amp;nbsp;iPad&amp;nbsp;Mini&amp;nbsp;&amp;nbsp;
&amp;gt;&amp;nbsp;armv7s:&amp;nbsp;iPhone&amp;nbsp;5,&amp;nbsp;iPhone&amp;nbsp;5c,&amp;nbsp;iPad&amp;nbsp;4&amp;nbsp;&amp;nbsp;
&amp;gt;&amp;nbsp;arm64:&amp;nbsp;iPhone&amp;nbsp;X，iPhone&amp;nbsp;8(Plus)，iPhone&amp;nbsp;7(Plus)，iPhone&amp;nbsp;6(Plus)，iPhone&amp;nbsp;6s(Plus),&amp;nbsp;iPhone&amp;nbsp;5s,&amp;nbsp;iPad&amp;nbsp;Air(2),&amp;nbsp;Retina&amp;nbsp;iPad&amp;nbsp;Mini(2,3)&amp;nbsp;&amp;nbsp;
&amp;gt;&amp;nbsp;arm64e:&amp;nbsp;XS/XS&amp;nbsp;Max/XR/&amp;nbsp;iPhone&amp;nbsp;11,&amp;nbsp;iPhone&amp;nbsp;11&amp;nbsp;pro
&amp;gt;&amp;nbsp;x86_64:&amp;nbsp;模拟器64位处理器
&amp;gt;&amp;nbsp;i386:&amp;nbsp;模拟器32位处理器&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;注意：Xcode 12之后，没有了Valid Architectures选项的设置。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;另：如果把Architectures从standard architectures(armv7,arm64)改为arm64，则会发现target无法选择模拟器运行了，所以建议Debug模式下修改为arm64、x86_64或者不修改，Release下设置为arm64。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;更新：经朋友指点，这个地方Architectures的设置，还有另外一种设置方法，Architectures不修改，Excluded Architectures中设置Release模式下 &lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;Any iOS &lt;/strong&gt;&lt;span class=&quot;mod-overview__keyword&quot; style=&quot;overflow-wrap: break-word; margin: 0px 4px; cursor: pointer; color: #0052D9; padding-right: 10px; background-image: url(&amp;quot;images/icon-keyword_32a.svg&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;SDK&lt;/strong&gt;&lt;/span&gt; -&amp;gt; armv7，也可以实现同样的效果。设置了之后，就是Release下把armv7的指令集排除在外。选中target会发现默认设置了 &lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;Any iOS Simulator SDK&lt;/strong&gt; -&amp;gt; arm64，意思是模拟器的时候排除arm64指令集。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;如下：&lt;/p&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 996px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 996px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233403172727844386409.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WX20210508-162103.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;ol class=&quot;ol-level-0 list-paddingleft-2&quot; style=&quot;overflow-wrap: break-word; margin-bottom: 16px; padding: 0px 0px 0px 6px; box-sizing: border-box; list-style-position: inside; list-style-image: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;li&gt;&lt;p&gt;Build Settings -&amp;gt; Generate Debug Symbols设置为NO&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 806.75px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 806.75px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233403172727844397079.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WeCom20210430-152121.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;Generate Debug Symbols的意思是生成调试符号，当这个选项设置为YES时，每个源文件在编译成.o文件时，编译参数多了-g和-gmodule，意思是generate complete debug info，所以产生的.o文件会大，从而最终生成的可执行文件也就会变大。&lt;/p&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;gt;&amp;nbsp;Generate&amp;nbsp;Debug&amp;nbsp;Symbols&amp;nbsp;(GCC_GENERATE_DEBUGGING_SYMBOLS),&amp;nbsp;Enables&amp;nbsp;or&amp;nbsp;disables&amp;nbsp;generation&amp;nbsp;of&amp;nbsp;debug&amp;nbsp;symbols.&amp;nbsp;When&amp;nbsp;debug&amp;nbsp;symbols&amp;nbsp;are&amp;nbsp;enabled,&amp;nbsp;the&amp;nbsp;level&amp;nbsp;of&amp;nbsp;detail&amp;nbsp;can&amp;nbsp;be&amp;nbsp;controlled&amp;nbsp;by&amp;nbsp;the&amp;nbsp;Debug&amp;nbsp;Information&amp;nbsp;Format&amp;nbsp;(DEBUG_INFORMATION_FORMAT)&amp;nbsp;setting.&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;注意Generate Debug Symbols设置为NO时，在Xcode中设置的断点不会中断，即不能断点调试。且最后不能生成DSYM文件，即使Debug Information Format设置了，也不能生成，因为首先要有调试信息然后才能生成DSYM文件，而设置为NO，意味着不产生调试信息，所以也就没办法生成DSYM文件。所以建议不要设置。&lt;/p&gt;&lt;ol class=&quot;ol-level-0 list-paddingleft-2&quot; style=&quot;overflow-wrap: break-word; margin-bottom: 16px; padding: 0px 0px 0px 6px; box-sizing: border-box; list-style-position: inside; list-style-image: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;li&gt;&lt;p&gt;Build Settings -&amp;gt; Deployment Postprocessing，Debug模式下设置NO，Release下设为YES&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;Deployment Postprocessing是Strip配置的总开关&lt;/p&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 996px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 996px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233403172727844396836.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WeCom20210430-171159@2x.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fhelp.apple.com%2Fxcode%2Fmac%2F11.4%2F%23%2Fitcaec37c2a6&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;官方解释：&lt;/a&gt;&lt;/p&gt;&lt;blockquote style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 0px 0px 24px; padding: 0px 15px; color: rgb(119, 119, 119); border-left: 4px solid rgb(221, 221, 221); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Deployment Postprocessing (DEPLOYMENT_POSTPROCESSING), If enabled, indicates that binaries should be stripped and file mode, owner, and group information should be set to standard values.&lt;/p&gt;&lt;/blockquote&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;注意：Deployment Postprocessing是Strip配置的总开关，只有这个设置为YES之后，下面的Strip Linked Product、Strip Debug Symbols During Copy的设置才会生效。&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;Build Settings -&amp;gt; Strip Linked Product，Debug下设置为NO，Release下设置为YES&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;对最后生成的二进制文件进行strip，去除不必要的符号信息，Release下可以为YES。&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[官方解释：](https://help.apple.com/xcode/mac/11.4/#/itcaec37c2a6)&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;gt;&amp;nbsp;Strip&amp;nbsp;Linked&amp;nbsp;Product&amp;nbsp;(STRIP_INSTALLED_PRODUCT),&amp;nbsp;If&amp;nbsp;enabled,&amp;nbsp;the&amp;nbsp;linked&amp;nbsp;product&amp;nbsp;of&amp;nbsp;the&amp;nbsp;build&amp;nbsp;will&amp;nbsp;be&amp;nbsp;stripped&amp;nbsp;of&amp;nbsp;symbols&amp;nbsp;when&amp;nbsp;performing&amp;nbsp;deployment&amp;nbsp;postprocessing.&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;注意：如果Deployment&amp;nbsp;Postprocessing不打开，该选项没有作用。去除了符号信息之后需要使用dSYM来进行符号化，所以需要将&amp;nbsp;Debug&amp;nbsp;Information&amp;nbsp;Format&amp;nbsp;修改为DWARF&amp;nbsp;with&amp;nbsp;dSYM&amp;nbsp;file（Release下），如果在Debug下设置为DWARF&amp;nbsp;with&amp;nbsp;dSYM&amp;nbsp;file那么在崩溃时将无法看到堆栈信息。&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;Build Settings -&amp;gt; Strip Debug Symbols During Copy，Debug下设置为NO，Release下设置为YES&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;文件拷贝编译阶段是否进行strip，设置为YES之后，会把拷贝进项目包的三方库、资源或者Extension的Debug Symbol去除。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fhelp.apple.com%2Fxcode%2Fmac%2F11.4%2F%23%2Fitcaec37c2a6&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;官方解释：&lt;/a&gt;&lt;/p&gt;&lt;blockquote style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 0px 0px 24px; padding: 0px 15px; color: rgb(119, 119, 119); border-left: 4px solid rgb(221, 221, 221); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Strip Debug Symbols During Copy (COPY_PHASE_STRIP), Specifies whether binary files that are copied during the build, such as in a Copy Bundle Resources or Copy Files build phase, should be stripped of debugging symbols. It does not cause the linked product of a target to be stripped—use Strip Linked Product (STRIP_INSTALLED_PRODUCT) for that.&lt;/p&gt;&lt;/blockquote&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;注意：如果Deployment Postprocessing不打开，该选项没有作用&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;Build Settings -&amp;gt; Symbols Hidden by Default，Debug模式下设置为NO，Release下设置为YES&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 996px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 996px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233403172727844393572.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WeCom20210430-171411@2x.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;Symbols Hidden by Default会把所有符号都定义成&amp;quot;private extern&amp;quot;，移除符号信息&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fhelp.apple.com%2Fxcode%2Fmac%2F11.4%2F%23%2Fitcaec37c2a6&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;官方解释：&lt;/a&gt;&lt;/p&gt;&lt;blockquote style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 0px 0px 24px; padding: 0px 15px; color: rgb(119, 119, 119); border-left: 4px solid rgb(221, 221, 221); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Symbols Hidden by Default (GCC_SYMBOLS_PRIVATE_EXTERN), When enabled, all symbols are declared private extern unless explicitly marked to be exported using &lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;attribute&lt;/strong&gt;((visibility(&amp;quot;default&amp;quot;))) in code. If not enabled, all symbols are exported unless explicitly marked as private extern. See Controlling Symbol Visibility in C++ Runtime Environment Programming Guide.&lt;/p&gt;&lt;/blockquote&gt;&lt;ol class=&quot;ol-level-0 list-paddingleft-2&quot; style=&quot;overflow-wrap: break-word; margin-bottom: 16px; padding: 0px 0px 0px 6px; box-sizing: border-box; list-style-position: inside; list-style-image: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;li&gt;&lt;p&gt;Build Settings -&amp;gt; Make Strings Read-Only设置为YES&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 996px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 996px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233403172727844356502.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WeCom20210430-171444@2x.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;复用字符串字面量&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fhelp.apple.com%2Fxcode%2Fmac%2F11.4%2F%23%2Fitcaec37c2a6&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;官方解释：&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;gt;&amp;nbsp;Make&amp;nbsp;Strings&amp;nbsp;Read-Only&amp;nbsp;(GCC_REUSE_STRINGS),&amp;nbsp;Reuse&amp;nbsp;string&amp;nbsp;literals.&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;ol-level-0 list-paddingleft-2&quot; style=&quot;overflow-wrap: break-word; margin-bottom: 16px; padding: 0px 0px 0px 6px; box-sizing: border-box; list-style-position: inside; list-style-image: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;li&gt;&lt;p&gt;Build Settings -&amp;gt; Dead Code Stripping设置为YES&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 733.047px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 733.047px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233404172727844467092.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WX20210510-131729.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;消除无效代码，C/C++/&lt;span class=&quot;mod-overview__keyword&quot; style=&quot;overflow-wrap: break-word; margin: 0px 4px; cursor: pointer; color: #0052D9; padding-right: 10px; background-image: url(&amp;quot;images/icon-keyword_32a.svg&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;Swift&lt;/span&gt; 等静态语言&lt;span class=&quot;mod-overview__keyword&quot; style=&quot;overflow-wrap: break-word; margin: 0px 4px; cursor: pointer; color: #0052D9; padding-right: 10px; background-image: url(&amp;quot;images/icon-keyword_32a.svg&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;编译器&lt;/span&gt;会在 link 的时候移除未使用的代码，对于OC等动态语言是无效的&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fhelp.apple.com%2Fxcode%2Fmac%2F11.4%2F%23%2Fitcaec37c2a6&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;官方解释：&lt;/a&gt;&lt;/p&gt;&lt;blockquote style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 0px 0px 24px; padding: 0px 15px; color: rgb(119, 119, 119); border-left: 4px solid rgb(221, 221, 221); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Dead Code Stripping (DEAD_CODE_STRIPPING), Activating this setting causes the -dead_strip flag to be passed to ld(1) via cc(1) to turn on dead code stripping.&lt;/p&gt;&lt;/blockquote&gt;&lt;ol class=&quot;ol-level-0 list-paddingleft-2&quot; style=&quot;overflow-wrap: break-word; margin-bottom: 16px; padding: 0px 0px 0px 6px; box-sizing: border-box; list-style-position: inside; list-style-image: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;li&gt;&lt;p&gt;&amp;lt;font color=&amp;#39;Gold&amp;#39;&amp;gt;Pod优化&amp;lt;/font&amp;gt;，如果项目是OC的，但CocoaPod中有使用了Swift库，打开了use_frameworks!，可以优化为针对单个Swift库使用use_frameworks!而不是全部第三方库都使用。代码如下：&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;Podfile
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;下面的这行代码还是打开，不需要注释掉
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;use_frameworks!

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;之前的其它代码
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;然后添加下面的代码，xxx是要打包成framework的库
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dynamic_frameworks&amp;nbsp;=&amp;nbsp;[&amp;#39;xxx&amp;#39;]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pre_install&amp;nbsp;do&amp;nbsp;|installer|
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;installer.pod_targets.each&amp;nbsp;do&amp;nbsp;|pod|
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;!dynamic_frameworks.include?(pod.name)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;def&amp;nbsp;pod.static_framework?;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;true
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;def&amp;nbsp;pod.build_type;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Pod::BuildType.static_library
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;在OC的项目中，Podfile如果引用了Swift的第三方库，一般都会直接打开use_frameworks!，对应的Pod中所有的库都会打包成动态库，以及Swift和OC库的依赖问题会导致依赖库增加，会造成包体积增大。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;修改方法有两种：&lt;/p&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;-&amp;nbsp;去除依赖的Swift第三方库，找对应的OC库替代；
-&amp;nbsp;通过Podfile里hook的方式，改动态库为静态库&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;这两种修改方法都可以显著减小包的体积。通过替代库可避免导入Swift相关的依赖基础库，且对应的use_frameworks!可以注释掉，相对来说，包会更小，但是改动比较大，需要把之前的库替换掉。而通过hook的方式，针对个别的库打包成动态库，其余的打包成静态库，项目修改比较小，包体积也能减小。具体采用哪种视具体项目情况而定。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;注意：Podfile按照上面的修改了之后，需要重新使用Pod install命令更新，然后编译时可能会有报错。&lt;/p&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;1.&amp;nbsp;如果报的错误是，&amp;#39;RuntimeError&amp;nbsp;-&amp;nbsp;[Xcodeproj]&amp;nbsp;Consistency&amp;nbsp;issue:&amp;nbsp;build&amp;nbsp;setting&amp;nbsp;`ARCHS`&amp;nbsp;has&amp;nbsp;multiple&amp;nbsp;values:&amp;nbsp;`{&amp;quot;Debug&amp;quot;=&amp;gt;&amp;quot;$(ARCHS_STANDARD)&amp;quot;,&amp;nbsp;&amp;quot;Release&amp;quot;=&amp;gt;[&amp;quot;arm64&amp;quot;]}`&amp;#39;，可以先把Architecture中的值改为一样的，Pod&amp;nbsp;install之后再改为不同指令集的。
2.&amp;nbsp;因为之前第三方库打包成framework的问题，如果遇到xxx&amp;nbsp;framework&amp;nbsp;not&amp;nbsp;found的错误，在Build&amp;nbsp;Setting中Other&amp;nbsp;Linker&amp;nbsp;Flags中进行修改，把对应的已经不是framework的库从其中移除即可。示例如下：&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&amp;lt;img src=&amp;quot;https://i.loli.net/2021/05/01/KBS9c6D8oVFYUsW.png&amp;quot; width=&amp;quot;50%&amp;quot; height=&amp;quot;50%&amp;quot;&amp;gt;&lt;/p&gt;&lt;ol class=&quot;ol-level-0 list-paddingleft-2&quot; style=&quot;overflow-wrap: break-word; margin-bottom: 16px; padding: 0px 0px 0px 6px; box-sizing: border-box; list-style-position: inside; list-style-image: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;li&gt;&lt;p&gt;&amp;lt;font color=&amp;#39;Gold&amp;#39;&amp;gt;Asset Catalog Compiler编译设置优化&amp;lt;/font&amp;gt;，Build Settings -&amp;gt; Asset Catalog Compiler - Options 中Optimization改为space&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 703.859px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 703.859px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233404172727844483259.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WX20210506-100606.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;这个选项可以改变actool在构建Assets.car时选取的编码压缩算法，减少包大小。可以使用下面的命令检查Assets.car中图片的编码压缩算法。&lt;/p&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;可以把对应信息生成.json文件，用于对比不同
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xcrun&amp;nbsp;--sdk&amp;nbsp;iphoneos&amp;nbsp;assetutil&amp;nbsp;--info&amp;nbsp;Assets.car&amp;nbsp;&amp;gt;&amp;nbsp;Assets.json&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;比如笔者的设置了之后，对比查看信息如下，可发现压缩的算法不同，占用空间的大小也不同&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&amp;lt;img src=&amp;quot;https://i.loli.net/2021/05/06/3fxO2lCLb8nEMra.png&amp;quot; width=&amp;quot;70%&amp;quot; height=&amp;quot;50%&amp;quot;&amp;gt;&lt;/p&gt;&lt;ol class=&quot;ol-level-0 list-paddingleft-2&quot; style=&quot;overflow-wrap: break-word; margin-bottom: 16px; padding: 0px 0px 0px 6px; box-sizing: border-box; list-style-position: inside; list-style-image: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;li&gt;&lt;p&gt;Build Settins -&amp;gt; Optimization Level改为-Oz&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 863.922px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 863.922px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233404172727844431972.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WX20210506-140136.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;Optimization Level默认为-Os，-Oz是Xcode 11之后才出现的编译优化选项，核心原理是对重复的连续机器指令外联成函数进行复用，因此开启Oz，能减少二进制的大小，但同时会带来执行效率但额外消耗。可参考&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fdeveloper.apple.com%2Fvideos%2Fplay%2Fwwdc2019%2F409%2F&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;What&amp;#39;s New in Clang and LLVM&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;在&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fdeveloper.apple.com%2Fvideos%2Fplay%2Fwwdc2019%2F409%2F&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;What&amp;#39;s New in Clang and LLVM&lt;/a&gt;的Presentation Slides中，苹果给出了Optimization Level各参数优化的选择对比，如下图，对于性能要求高的，建议选择-O2和-O3，对于包大小敏感的，可选择-Os和-Oz，默认-Os是性能和大小平衡比较好的。最终选择什么，需要读者根据自己实际项目而定。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&amp;lt;img src=&amp;#39;https://i.loli.net/2021/05/06/jvVrKUpMNRXOqGC.png&amp;#39; width=&amp;quot;70%&amp;quot; height=&amp;quot;60%&amp;quot;&amp;gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;Optimization Level各参数对比：&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fhelp.apple.com%2Fxcode%2Fmac%2F11.4%2F%23%2Fitcaec37c2a6&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;官方解释：&lt;/a&gt;&lt;/p&gt;&lt;blockquote style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 0px 0px 24px; padding: 0px 15px; color: rgb(119, 119, 119); border-left: 4px solid rgb(221, 221, 221); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Smallest, Aggressive Size Optimizations: This setting enables additional size savings by isolating repetitive code patterns into a compiler generated function. -Oz&lt;/p&gt;&lt;/blockquote&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&amp;lt;img src=&amp;#39;https://i.loli.net/2021/05/06/alvWVYtD8MsQu3m.png&amp;#39; width=&amp;quot;70%&amp;quot; height=&amp;quot;60%&amp;quot;&amp;gt;&lt;/p&gt;&lt;h5 id=&quot;9vsho&quot; name=&quot;Xcode%E7%BC%96%E8%AF%91%E8%AE%BE%E7%BD%AE%E4%BC%98%E5%8C%96%E6%80%BB%E7%BB%93%E5%A6%82%E4%B8%8B%EF%BC%9A&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; font-size: 14px; box-sizing: border-box; list-style: inherit; line-height: 24px; font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;Xcode编译设置优化总结如下：&lt;/h5&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;优化结果&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;笔者最初项目大小最初为22.9M，设置了Pod优化之后大小缩减为21M，设置了Asset Catalog Compiler - Options 中Optimization为space之后，项目大小变为20.7M，再设置了上面其它Xcode编译优化之后，项目变为13.2M（笔者把Architecture设为arm64）&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;设置Pod优化之后各部分对比&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot;table-wrapper&quot; style=&quot;overflow-wrap: break-word; margin: 12px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; outline: none; position: relative; overflow-x: auto; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;table width=&quot;996&quot;&gt;&lt;thead style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;内容&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;大小&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;_CodeSignature&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;67 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;.lproj&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;4 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Frameworks&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&amp;lt;font color=&amp;#39;red&amp;#39;&amp;gt;21.4 MB&amp;lt;/font&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Plugins&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;181 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Assets.car&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;4.9M&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;embedded.mobileprovision&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;8KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Info.plist&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;6 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;exec格式的xxx&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&amp;lt;font color=&amp;#39;red&amp;#39;&amp;gt;19.2 MB&amp;lt;/font&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;其它资源文件&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;1.4 MB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;简单对比大小之后可以发现，Frameworks从35M减少到了21.4M，而exec文件从13M升到了19.2M，但总的ipa包大小变为了21M，比之前但22.9M降低了。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;为什么会这样呢？还记得Frameworks文件夹里放的是什么内容吗？Framework中放的Pod中设置的第三方的动态库、以及Swift Support库。仔细观察Frameworks文件夹中的内容，可以发现，之前在这里面的第三方的.framework，除了指定的打包成动态库的第三方xxx、和Swift Support库还在，其他的都不见了。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;还记得笔者改的是什么吗？笔者把Pod中第三方库从都使用动态库改为了个别使用动态库、其它使用静态库。因为动态库和静态库链接的方式的不同，&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;动态库链接时不复制，在程序启动后用动态加载&lt;/strong&gt;，所以是单独放在Framework文件夹下；而静态库是&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;链接时会被完整的复制到可执行文件中&lt;/strong&gt;。所以，于是就出现了这样的结果，Frameworks文件大小减少，而可执行文件大小增加。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;设置了Asset Catalog Compiler - Options 中Optimization为space后对比&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot;table-wrapper&quot; style=&quot;overflow-wrap: break-word; margin: 12px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; outline: none; position: relative; overflow-x: auto; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;table width=&quot;996&quot;&gt;&lt;thead style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;内容&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;大小&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;_CodeSignature&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;67 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;.lproj&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;4 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Frameworks&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;21.4 MB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Plugins&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;181 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Assets.car&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&amp;lt;font color=&amp;#39;red&amp;#39;&amp;gt;4.7M&amp;lt;/font&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;embedded.mobileprovision&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;8KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Info.plist&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;6 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;exec格式的xxx&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;19.2 MB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;其它资源文件&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;1.4 MB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;对比之后发现，Assets.car中大小从4.9M减少到了4.7M，总的打包出来的ipa大小减少了0.3M，说明asset压缩有效。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;设置了Optimization Level为-Oz后对比&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot;table-wrapper&quot; style=&quot;overflow-wrap: break-word; margin: 12px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; outline: none; position: relative; overflow-x: auto; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;table width=&quot;996&quot;&gt;&lt;thead style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;内容&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;大小&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;_CodeSignature&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;67 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;.lproj&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;4 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Frameworks&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;21.4 MB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Plugins&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;181 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Assets.car&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;4.7M&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;embedded.mobileprovision&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;8KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Info.plist&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;6 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;exec格式的xxx&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&amp;lt;font color=&amp;#39;red&amp;#39;&amp;gt;18.9 MB&amp;lt;/font&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;其它资源文件&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;1.4 MB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;对比之后发现，exec的可执行文件大小从19.2M减少到了18.9M，说明优化有效，但总的打包出来的ipa大小并没有改变（上传到fir后，包小了0.03M），故而最终这个选项笔者最终没有打开。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;Xcode其它编译设置优化之后对比&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot;table-wrapper&quot; style=&quot;overflow-wrap: break-word; margin: 12px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; outline: none; position: relative; overflow-x: auto; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;table width=&quot;996&quot;&gt;&lt;thead style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;内容&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;大小&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;_CodeSignature&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;67 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;.lproj&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;4 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Frameworks&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&amp;lt;font color=&amp;#39;red&amp;#39;&amp;gt;11.1 MB&amp;lt;/font&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Plugins&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&amp;lt;font color=&amp;#39;red&amp;#39;&amp;gt;83 KB&amp;lt;/font&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Assets.car&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;4.7M&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;embedded.mobileprovision&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;8KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Info.plist&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;6 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;exec格式的xxx&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&amp;lt;font color=&amp;#39;red&amp;#39;&amp;gt;10.3 MB&amp;lt;/font&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;其它资源文件&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;1.4 MB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;简单对比大小之后可以发现，Frameworks从21.4M减少到了11.1M，Plugins从181KB减少到了83KB，exec文件也从19.2M减少到了10.3M。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;同样为什么会这样呢？笔者设置了strip移除了符号信息，设置了打包只生成arm64架构指令集的包，所以Framework和exec都变小了，那Plugin呢？Plugin中是App创建的扩展，笔者针对通知扩展，也设置了只生成arm64指令集的包，所以Plugin也变小了。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;优化总结&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 996px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 996px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233404172727844429052.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WX20210508-162503.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;也许有人觉得笔者目前项目包没有太大，做这个优化是否有意义？在笔者看来，包大小优化应该是习惯，不是因为包大了才去优化，而是因为觉得有优化空间，所以才优化。打包出来ipa的包小，说明历史负担不重，船小好调头，编译打包速度也快，而且试错成本也低，恰恰是正应该优化的时候。优化总结出来的经验教训，落入文档，后续开发时能时刻注意，对开发来说是更好的。&lt;/p&gt;&lt;h4 id=&quot;a79o9&quot; name=&quot;%E8%B5%84%E6%BA%90%E6%96%87%E4%BB%B6%E4%BC%98%E5%8C%96&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px 8px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 24px; font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;资源文件优化&lt;/h4&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;资源文件的优化，通常来说是比较简单的，但是资源文件的优化是需要持续进行的，前面介绍的Xcode编译设置优化，配置好了之后，后续开发过程中只要不修改配置，都无需重复关注。但资源文件不同，随着项目的迭代，会不断引入新的资源文件，不断有废弃资源的产生，所以资源文件的优化是要持续进行的。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;资源文件的优化分为两部分，即：无用资源的删除、已用资源的压缩。在这里建议分先后顺序，即先做删除再做压缩，因为如果先压缩了，结果发现是无用资源，就白白浪费了力气。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;无用资源的删除：&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;已定义未使用的代码文件&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;已废弃业务，代码还在&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;已引用的图片但未使用&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;某些重复资源导入&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;已用资源的压缩：&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;项目中引入图片、网页、json、音频等文件的压缩&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;下面一步步的来实践：&lt;/p&gt;&lt;h5 id=&quot;drvih&quot; name=&quot;%E6%97%A0%E7%94%A8%E8%B5%84%E6%BA%90%E7%9A%84%E5%88%A0%E9%99%A4&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; font-size: 14px; box-sizing: border-box; list-style: inherit; line-height: 24px; font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;无用资源的删除&lt;/h5&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;随着项目的迭代，每个项目都会或多或少存在冗余。可能是开发了的功能未上线但产品让保留，保留着保留着就忘记了；可能是已下线的业务，没人通知到开发，于是代码逻辑一直都在；可能是删除某些业务代码时，对应的图片资源未删除；又或者是每个开发，导入各自熟悉的第三方库使用。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;这部分的优化在笔者看来，也分为两步，一是预防，一是治理。笔者个人感觉预防比治理更重要。因为预防是前置，预防到位了，治理就会很轻松。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;预防&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;上面说的场景，读者可能都遇到过，那要怎么做才能避免出现上面的情况，或者尽量少出现上面的情况？&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;笔者个人想法是通过规范的流程来，有一套规范的流程，按流程执行，避免出现信息不对等的情况。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;产品和开发之间的信息不对等，会导致业务相关的冗余，产品知道具体业务的数据，而开发不清楚，所以可以通过定期同步给开发，让开发也能了解到对应业务是否活跃，从而及时对项目进行优化。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;开发之间的信息不对等，会导致各自开发自己的，重复造轮子，所以可以通过建立公共文档，开发的流程规范、项目使用第三方库的规范、设计规范、代码规范都列举出来，每个人都能根据对应的文档了解到对应项目的信息，每个人开发都应该有一套统一的标准。这样就可以避免一人一套代码的问题。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;具体的规范流程读者可以针对自己公司的实际情况来，可以思考一下，之前开发中是否出现了类似的问题，出现了之后是否有改变，怎么能避免再次出现同样的问题？&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;治理&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;针对无用资源的删除&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;已定义未使用的代码&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;可使用AppCode进行分析，打开AppCode，待索引完成后，选择顶部菜单中的Code-&amp;gt;Inspect Code，然后选择范围，whole Project点击OK，等待AppCode静态分析即可。静态分析完以后，可以在Unused code里看到所有的无用代码。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&amp;lt;img src=&amp;quot;https://i.loli.net/2021/05/05/qvHd3ODLcE1pf2n.png&amp;quot; width=&amp;quot;50%&amp;quot; height=&amp;quot;50%&amp;quot;&amp;gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&amp;lt;img src=&amp;quot;https://i.loli.net/2021/05/05/jwpaohKbyqcxI9v.png&amp;quot; width=&amp;quot;50%&amp;quot; height=&amp;quot;50%&amp;quot;&amp;gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;AppCode中无用代码静态分析的类型有以下几种：&lt;/p&gt;&lt;div class=&quot;table-wrapper&quot; style=&quot;overflow-wrap: break-word; margin: 12px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; outline: none; position: relative; overflow-x: auto; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;table width=&quot;996&quot;&gt;&lt;thead style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;内容&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;大小&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Unused class&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;无用类&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Unused import statement&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;无用类引入声明&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Unused property&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;无用属性&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Unused method&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;无用方法&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Unused parameter&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;无用参数&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Unused instance variable&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;无用实例变量&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Unused local variable&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;无用局部变量&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Unused value&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;无用值声明&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Unused macro&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;无用宏定义&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Unused global declaration&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;无用全局证明&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;AppCode静态分析结果出来之后，删除前要经过确认，因为静态分析的结果可能会有误差，比如针对performSelector调用的方法就会被检测为没有调用。&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;已废弃业务，代码还在&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;需要梳理业务流程，结合线上业务数据点击量，同产品和业务确认对应功能是否下线，从而决定是否移除对应的业务模块代码。&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;已引入未使用图片&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;推荐使用工具&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fgithub.com%2Ftinymind%2FLSUnusedResources&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;LSUnusedResources&lt;/a&gt;，原理大致是遍历资源目录下后缀 &amp;quot;imageset&amp;quot;, &amp;quot;jpg&amp;quot;, &amp;quot;png&amp;quot;... 的文件，然后在源文件 &amp;quot;m&amp;quot;, &amp;quot;swift&amp;quot;, &amp;quot;xib&amp;quot;, &amp;quot;storyboard&amp;quot;... 中字符串匹配，无匹配则是无用的资源文件。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;使用时注意勾选Ignore similar name，然后点击右上角的Browse选中要扫描的项目地址，点击右下角的search，就会开始扫描，结果会在底部Unused Results中展示出来，然后CMD+A全选，export，导出到一个文本文件中。也可以在对应单条Item上面双击，会打开对应的文件夹。建议删除前在项目中搜索确认，是否确实没有使用（类似字符串中间替换的可能会被扫描出来，所以删除前需要确认）&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&amp;lt;img src=&amp;quot;https://i.loli.net/2021/05/01/qdguJoHpK6IybhZ.png&amp;quot; width=&amp;quot;50%&amp;quot; height=&amp;quot;50%&amp;quot;&amp;gt;&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;某些重复资源的导入&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;重复资源的导入，分为两个方面，一方面是针对第三方SDK，另一方面是项目文件。&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;针对第三方SDK&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;项目中功能类似的SDK建议保留一个，比如埋点统计的友盟、TalkingData等，线上&lt;a href=&quot;https://cloud.tencent.com/product/es?from_column=20065&amp;from=20065&quot; target=&quot;_blank&quot; class=&quot;rno-markdown__textlink-new&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; padding: 0px 10px 0px 0px; margin: 0px 4px; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217); cursor: pointer; background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiIGZpbGw9Im5vbmUiPjxwYXRoIGQ9Ik00LjMwMyA1LjAxbC0uNzA3LjcwN2ExLjUgMS41IDAgMDEtMi4xMjEtMi4xMjFsLjcwNy0uNzA3LS43MDctLjcwNy0uNzA3LjcwN2EyLjUgMi41IDAgMTAzLjUzNSAzLjUzNWwuNzA4LS43MDctLjcwOC0uNzA3ek01LjAxIDQuMzAzbC43MDguNzA3LjcwNy0uNzA3QTIuNSAyLjUgMCAwMDIuODg5Ljc2N2wtLjcwNy43MDcuNzA3LjcwOC43MDctLjcwOGExLjUgMS41IDAgMDEyLjEyMiAyLjEyMmwtLjcwNy43MDd6IiBmaWxsPSIjMDA1MkQ5Ii8+PHBhdGggZD0iTTQuMzAzIDIuMTgybC43MDguNzA3LTIuMTIyIDIuMTItLjcwNy0uNzA2IDIuMTIxLTIuMTIxeiIgZmlsbD0iIzAwNTJEOSIvPjwvc3ZnPg==&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none;&quot;&gt;日志分析&lt;/a&gt;的听云、Bugly等，又或者网络请求、&lt;span class=&quot;mod-overview__keyword&quot; style=&quot;overflow-wrap: break-word; margin: 0px 4px; cursor: pointer; color: #0052D9; padding-right: 10px; background-image: url(&amp;quot;images/icon-keyword_32a.svg&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;UI&lt;/span&gt;布局的类库，建议分析相同功能的类库，结合实际情况，保留一个即可；另外，有些第三方类库导入时，可只导入实际使用的部分，不需全量导入，也是可以优化的地方。&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;针对项目文件&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;使用 fdupes 工具进行重复文件扫描，原理是：通过校验所有资源的 MD5，筛选出项目中的重复资源，文件比较顺序是大小对比 &amp;gt; 部分 MD5 签名对比 &amp;gt; 完整 MD5 签名对比 &amp;gt; 逐字节对比。来自：&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fwww.zybuluo.com%2Fqidiandasheng%2Fnote%2F1662385&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;包体积大小：瘦身&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;fdupes使用如下：&lt;/p&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;//&amp;nbsp;1.&amp;nbsp;首先安装fdupes
brew&amp;nbsp;install&amp;nbsp;fdupes

//&amp;nbsp;2.&amp;nbsp;使用，其中xxx是要扫描的目录，yyy.txt是扫描结果输出的文件
fdupes&amp;nbsp;-Sr&amp;nbsp;/Users/.../xxx/&amp;nbsp;&amp;gt;&amp;nbsp;/Users/.../yyy.txt&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;输出结果类似于下面这样，通常相同文件可通过修改引用，仅保留一份源文件就可以。&lt;/p&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 996px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 996px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233405172727844532775.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WX20210505-103131@2x.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;h5 id=&quot;4t232&quot; name=&quot;%E5%B7%B2%E7%94%A8%E8%B5%84%E6%BA%90%E7%9A%84%E5%8E%8B%E7%BC%A9&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; font-size: 14px; box-sizing: border-box; list-style: inherit; line-height: 24px; font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;已用资源的压缩&lt;/h5&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;项目中引入图片、网页、json、音频等文件的压缩&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;网页的压缩指的是，放入APP资源中的js文件，最好是经过H5端压缩后的。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;json文件的压缩，如果不是打开APP时马上要用到的数据，可采取把对应资源放到服务端，下载后使用。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;音频文件的压缩，则是在可接受的范围之内，选择系统可支持的压缩比率高的格式。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;而最需要注意的是图片的压缩，图片的压缩，分为几个部分&lt;/p&gt;&lt;ol class=&quot;ol-level-0 list-paddingleft-2&quot; style=&quot;overflow-wrap: break-word; margin-bottom: 16px; padding: 0px 0px 0px 6px; box-sizing: border-box; list-style-position: inside; list-style-image: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;li&gt;&lt;p&gt;单色图标、简单的功能图标，建议使用IconFont，矢量图标库的格式，既能统一规范格式，又能减少资源文件大小。圆角和阴影图片尽量代码实现。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;IconFont的使用可参考笔者之前写的Demo——&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fgithub.com%2Fmokong%2FIconFont&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;IconFont&lt;/a&gt;&lt;/p&gt;&lt;ol class=&quot;ol-level-0 list-paddingleft-2&quot; style=&quot;overflow-wrap: break-word; margin-bottom: 16px; padding: 0px 0px 0px 6px; box-sizing: border-box; list-style-position: inside; list-style-image: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;li&gt;&lt;p&gt;针对普通图片，可以调用tinyPNG &lt;span class=&quot;mod-overview__keyword&quot; style=&quot;overflow-wrap: break-word; margin: 0px 4px; cursor: pointer; color: #0052D9; padding-right: 10px; background-image: url(&amp;quot;images/icon-keyword_32a.svg&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none; box-sizing: border-box; list-style: inherit;&quot;&gt;API&lt;/span&gt;进行压缩，这里可以使用笔者之前修改的脚本&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fgithub.com%2Fmokong%2FBatchProcessImage&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; color: rgb(0, 82, 217);&quot;&gt;BatchProcessImage&lt;/a&gt;，调用的是tinyPNG的API可以一次性压缩500张图片，而且只需要指定项目目录，会自动压缩后替换原来的图片，不需要手动导入导出图片。使用可参考链接&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fgithub.com%2Fmokong%2FBatchProcessImage&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; color: rgb(0, 82, 217);&quot;&gt;BatchProcessImage&lt;/a&gt;，需要注意的是注意python版本，python3和python，以及pip3和pip的选择，安装依赖库的时候使用的哪个python版本，最后调用的脚本命令的时候就要用对应的python版本。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;另：如果项目图片超出500张，可以修改一下脚本文件，即：压缩过程中把压缩处理过的图片存储下来，然后第二次执行时，对于压缩过的不处理，就可以接着上次压缩到的继续压缩了。而如果需要对压缩过的再次压缩，只需要把存储下来的压缩过的图片名字清除即可。&lt;/p&gt;&lt;ol class=&quot;ol-level-0 list-paddingleft-2&quot; style=&quot;overflow-wrap: break-word; margin-bottom: 16px; padding: 0px 0px 0px 6px; box-sizing: border-box; list-style-position: inside; list-style-image: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;li&gt;&lt;p&gt;放入xcassets里的2x和3x图片，在上传时，会根据具体设备分开对应分辨率的图片，不会同时包含。而放入Bundle中的都会包含。所以要尽量把图片放入xcassets中。但是，根据&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fblog.csdn.net%2FByteDanceTech%2Farticle%2Fdetails%2F112504772&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; color: rgb(0, 82, 217);&quot;&gt;抖音品质建设 - iOS 安装包大小优化实践篇&lt;/a&gt;中介绍的，Assets.car编译过程中有时会选择一些图片，拼凑成一张大图来提高图片的加载效率。被放进这张大图的小图会变为通过偏移量的引用，建议使用频率高且小的图片放到Asset.car中，Asset.car能保证加载和渲染速度最优。但是大的图片（大于100K）就不要放入Asset.car中了。大的图片可以考虑将图片转成&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fdevelopers.google.com%2Fspeed%2Fwebp%2Fdocs%2Fusing&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; color: rgb(0, 82, 217);&quot;&gt;WebP&lt;/a&gt;。&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fdevelopers.google.com%2Fspeed%2Fwebp%2Fdocs%2Fusing&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; color: rgb(0, 82, 217);&quot;&gt;WebP&lt;/a&gt;是Google公司的一个开源项目，能够把图片压缩到很小，但是肉眼看不出来差别，目前iOS常用的图片显示类库都用支持该格式解析的拓展。可使用&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=http%3A%2F%2Fisparta.github.io%2F&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; color: rgb(0, 82, 217);&quot;&gt;iSparta&lt;/a&gt;进行批量转换。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;私有Pod库中的资源文件，建议在Pod库里面的Resource目录下新建Asset Catalog文件，命名为Images.xcassets，私有库使用的图片放入这里，然后手动修改该SDK的podspec，指定resource_bundles使用Images.xcassets。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;s.resource_bundles&amp;nbsp;=&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;xxsdk&amp;#39;&amp;nbsp;=&amp;gt;&amp;nbsp;[&amp;#39;xxx/Assets/.../*.xcassets&amp;#39;]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;Ps: Pod资源文件引用方式有 resource_bundles 和 resources，推荐使用 resource_bundles。参考&lt;a class=&quot;&quot; href=&quot;https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Fjuejin.cn%2Fpost%2F6844904169938092045%23heading-15&amp;source=article&amp;objectId=1829222&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; box-sizing: border-box; list-style: inherit; word-break: break-all; color: rgb(0, 82, 217);&quot;&gt;深入探索 iOS 包体积优化&lt;/a&gt;&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;resource_bundles：允许定义当前 Pod 库的资源包的名称和文件。用 hash 的形式来声明，key 是 bundle 的名称，value 是需要包括的文件的通配 patterns。CocoaPods 官方强烈推荐使用 resource_bundles，因为用 key-value 可以避免相同名称资源的名称冲突。同时建议 bundle 的名称至少应该包括 Pod 库的名称，可以尽量减少同名冲突。使用resource_bundles会为指定的资源打一个.bundle，所以获取图片时要注意指定bundle的位置：&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NSString&amp;nbsp;*bundlePath&amp;nbsp;=&amp;nbsp;[[NSBundle&amp;nbsp;bundleForClass:[self&amp;nbsp;class]].resourcePath&amp;nbsp;stringByAppendingPathComponent:@&amp;quot;/PAX.bundle&amp;quot;];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NSBundle&amp;nbsp;*resource_bundle&amp;nbsp;=&amp;nbsp;[NSBundle&amp;nbsp;bundleWithPath:bundlePath];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UIImage&amp;nbsp;*image&amp;nbsp;=&amp;nbsp;[UIImage&amp;nbsp;imageNamed:@&amp;quot;xxxx&amp;quot;&amp;nbsp;inBundle:resource_bundle&amp;nbsp;compatibleWithTraitCollection:nil];&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;resources：使用 resources 来指定资源，被指定的资源只会简单的被 copy 到目标工程中（主工程）。官方认为用 resources 是无法避免同名资源文件的冲突的，同时，Xcode 也不会对这些资源做优化。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;5.&amp;nbsp;最后，是Xcode中关于图片压缩的设置，有时候压缩了图片之后，发现包大小并没有改变太多，可能是因为Xcode的Compress&amp;nbsp;PNG&amp;nbsp;Files选项的原因。建议如果自己对图片进行了压缩，就可以把Xcode的Compress&amp;nbsp;PNG&amp;nbsp;Files设置为NO。&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;Compress&amp;nbsp;PNG&amp;nbsp;Files&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;打包的时候自动对图片进行无损压缩&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code&quot; style=&quot;overflow-wrap: break-word; margin: 24px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 6px 8px; box-sizing: border-box; list-style: inherit; border: 1px solid rgb(225, 228, 233); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; display: flex; align-items: center; justify-content: space-between; gap: 36px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-info&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 22px; color: rgb(0, 0, 0); font-size: 12px; flex: 1 1 0%; max-width: 48%; white-space: nowrap;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-item is-type&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative; align-items: center; display: inline-block; vertical-align: middle; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis;&quot;&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;代码语言：&lt;/span&gt;txt&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;rno-markdown-code-toolbar-opt&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; display: flex; align-items: center; gap: 20px;&quot;&gt;&lt;div class=&quot;rno-markdown-code-toolbar-copy&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(0, 0, 0); font-size: 12px; line-height: 22px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;&quot;&gt;&lt;em class=&quot;icon-copy&quot; style=&quot;overflow-wrap: break-word; font-weight: inherit; box-sizing: border-box; list-style: inherit; display: inline-block; width: 13px; height: 15px; background: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjkxNCAxNS41di0xMmgxMHYxMmgtMTB6bTgtMTBoLTZ2OGg2di04em0tMy0zaC02djEwaC0yVi41aDEwdjJoLTJ6IiBmaWxsPSIjMTgxODE4Ii8+PC9zdmc+&amp;quot;) center center / cover no-repeat;&quot;&gt;&lt;/em&gt;&lt;span class=&quot;is-m-hidden&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;developer-code-block&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; position: relative;&quot;&gt;&lt;pre class=&quot;prism-token token line-numbers language-txt&quot; tabindex=&quot;0&quot; style=&quot;overflow-wrap: normal; box-sizing: border-box; list-style: inherit; margin-top: 0px; margin-bottom: 0px; padding: 1em 1em 1em 3.8em; color: rgb(204, 204, 204); background-color: rgb(80, 85, 107); border-radius: 3px; overflow: auto; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; word-spacing: normal; word-break: normal; line-height: 1.5; tab-size: 4; hyphens: none; min-height: 14px; position: relative; counter-reset: linenumber 0;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;Remove&amp;nbsp;Text&amp;nbsp;Medadata&amp;nbsp;From&amp;nbsp;PNG&amp;nbsp;Files&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;移除&amp;nbsp;PNG&amp;nbsp;资源的文本字符&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;h5 id=&quot;5cts2&quot; name=&quot;%E8%B5%84%E6%BA%90%E6%96%87%E4%BB%B6%E4%BC%98%E5%8C%96%E6%80%BB%E7%BB%93%E5%A6%82%E4%B8%8B%EF%BC%9A&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; font-size: 14px; box-sizing: border-box; list-style: inherit; line-height: 24px; font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;资源文件优化总结如下：&lt;/h5&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;优化结果&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;笔者项目的ipa大小从Xcode编译优化后的大小为13.2M，经过了资源文件优化之后大小缩减为10.3M。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;资源文件优化之后各部分对比&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot;table-wrapper&quot; style=&quot;overflow-wrap: break-word; margin: 12px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; outline: none; position: relative; overflow-x: auto; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;table width=&quot;996&quot;&gt;&lt;thead style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;内容&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;大小&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;_CodeSignature&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;67 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;.lproj&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;4 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Frameworks&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;11.1 MB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Plugins&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;83 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Assets.car&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&amp;lt;font color=&amp;#39;red&amp;#39;&amp;gt;2.4M&amp;lt;/font&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;embedded.mobileprovision&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;8KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Info.plist&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;6 KB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;exec格式的xxx&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;10.3 MB&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;其它资源文件&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&amp;lt;font color=&amp;#39;red&amp;#39;&amp;gt;952 KB&amp;lt;/font&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;简单对比之后发现，Assets.car从4.7M减少到2.4M，其它资源文件从1.4M减少到952KB，说明资源压缩有效。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; word-break: break-all;&quot;&gt;优化总结&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;见图，😄&lt;/p&gt;&lt;p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: 996px; white-space-collapse: collapse !important;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 996px;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925233405172727844597710.png&quot;&gt;&lt;/div&gt;&lt;div class=&quot;figure-desc&quot; style=&quot;overflow-wrap: break-word; margin: 10px auto 16px; padding: 0px; box-sizing: border-box; list-style: inherit; color: rgb(102, 102, 102); max-width: 61.8%; line-height: 22px !important;&quot;&gt;WX20210506-111104.png&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/p&gt;&lt;h4 id=&quot;ll5j&quot; name=&quot;%E7%9B%91%E6%8E%A7%E6%9C%BA%E5%88%B6%EF%BC%9F&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px 8px; padding: 0px; box-sizing: border-box; list-style: inherit; line-height: 24px; font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;监控机制？&lt;/h4&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;瘦身完成之后，如何保证包大小不会再次迅速增大？就像减肥之后不会迅速反弹一样？就需要依赖适当的监控机制和合理的流程规范来控制。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;监控机制保证实时发现问题，每次打包完成后，运行脚本比较包大小差异，如果有增大超过了设置的阈值，则邮件通知相关开发，开发关注排查是什么原因导致包大小变大；同时做好记录，每次打包的包大小变化及时注意记录，造成包大小变化的原因，落入文档。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;流程规范是用于保证每个项目开发者知晓开发中注意什么，养成好的开发习惯，避免造成包大小的突然变大。&lt;/p&gt;&lt;ul class=&quot;ul-level-0 list-paddingleft-2&quot; style=&quot;list-style-type: none;&quot;&gt;&lt;li&gt;&lt;p&gt;引入新的三方库时，要考虑是否已有同类型的库，是否可以自己实现，是否会造成体积增大。尽量避免Objective-C和Swift混编，优先引用相同语言类型的库&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;新增的图片资源，关注大小，考虑是否能用Iconfont，是否能代码实现，注意放入项目的位置，如果体积太大，压缩后使用&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;废弃模块不要保留，及时清理&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;及时关注包大小变化，对于包大小变化的原因及结果整理落入文档，反馈总结&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;7o4fp&quot; name=&quot;%E6%80%BB%E7%BB%93&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px 8px; padding: 0px; font-size: 16px; box-sizing: border-box; list-style: inherit; line-height: 26px; font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;总结&lt;/h3&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;截止目前为止，笔者总体项目优化结果如下：&lt;/p&gt;&lt;div class=&quot;table-wrapper&quot; style=&quot;overflow-wrap: break-word; margin: 12px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; outline: none; position: relative; overflow-x: auto; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;table width=&quot;996&quot;&gt;&lt;thead style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;优化内容&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;th style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); background-color: rgb(245, 247, 250); color: rgb(103, 116, 137); text-align: center; font-weight: normal; word-break: keep-all;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-header&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 0px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;ipa大小&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;原始&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;22.9M&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&amp;lt;font color=&amp;#39;Gold&amp;#39;&amp;gt;Xcode编译优化-Pod优化后&amp;lt;/font&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;21M&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&amp;lt;font color=&amp;#39;Gold&amp;#39;&amp;gt;Xcode编译优化-Asset Catalog Compiler编译设置优化后&amp;lt;/font&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;20.7M&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;Xcode编译优化-其它&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;13.2M&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;资源优化&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;overflow-wrap: break-word; margin: 0px; padding: 12px 16px; box-sizing: border-box; list-style: inherit; border-color: rgb(225, 230, 240); text-align: center;&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;div class=&quot;table-cell&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; list-style: inherit;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;10.3M&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;达到了预期瘦身的效果，虽然还有更进一步优化的空间，比如把项目中唯一引用的Swift的第三方库改为OC的，从而可以去除混编，能大幅缩减项目大小，但是由于需要改动业务代码，笔者暂时搁置了。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;总的来说，笔者在业务代码没有改动的情况下，经过Xcode编译优化和资源文件压缩，把包大小从22.9M压缩到了10.3M，就结果来说是超出了预期。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; white-space: pre-wrap; background-color: rgb(255, 255, 255);&quot;&gt;但是作为优化包大小的实践来说还有待未完待续的地方，就是最后一步的代码优化，笔者打算单独抽一篇文章，来补充一下，使用代码优化的流程逻辑。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 25 Sep 2024 23:33:33 +0800</pubDate></item><item><title>ld: file not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchai...</title><link>http://x.zx.cdqlx.top/?id=25</link><description>&lt;h1 class=&quot;_1RuRku&quot; style=&quot;box-sizing: border-box; margin-top: 32px; margin-bottom: 0.5em; color: rgb(64, 64, 64); text-rendering: optimizelegibility; font-size: 30px; word-break: break-word; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-wrap: wrap;&quot;&gt;ld: file not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchai...&lt;/h1&gt;&lt;div&gt;&lt;div&gt;&lt;h1&gt;前言&lt;/h1&gt;&lt;p&gt;Xcode14.3升级后，运行以前旧项目出现如下报错：&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-bash&quot;&gt;ld:&amp;nbsp;file&amp;nbsp;not&amp;nbsp;found:&amp;nbsp;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a
clang:&amp;nbsp;error:&amp;nbsp;linker&amp;nbsp;command&amp;nbsp;failed&amp;nbsp;with&amp;nbsp;exit&amp;nbsp;code&amp;nbsp;1&amp;nbsp;(use&amp;nbsp;-v&amp;nbsp;to&amp;nbsp;see&amp;nbsp;invocation)&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;从错误日志来看是缺少&lt;code&gt;libarclite_iphonesimulator.a&lt;/code&gt;文件。&lt;/p&gt;&lt;h1&gt;问题解决&lt;/h1&gt;&lt;p&gt;在【访达-应用程序-Xcode】点击右键，显示包内容，根据一下路径一直到最后目录。&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;没有&lt;code&gt;arc&lt;/code&gt;文件的话，自己创建一个，并下载下面这些&lt;code&gt;.a&lt;/code&gt;文件，放到&lt;code&gt;arc&lt;/code&gt;文件夹中。&lt;br/&gt;文件下载地址：&lt;a href=&quot;https://links.jianshu.com/go?to=https%3A%2F%2Fgithub.com%2Fwnkpzzz%2FCZLibarclite-Files%2Ftree%2Fmain&quot; target=&quot;_blank&quot;&gt;https://github.com/wnkpzzz/CZLibarclite-Files/tree/main&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 25 Sep 2024 21:48:36 +0800</pubDate></item><item><title>解决XCode错误：Command PhaseScriptExecution failed with a nonzero exit code</title><link>http://x.zx.cdqlx.top/?id=24</link><description>&lt;h1 class=&quot;_1RuRku&quot; style=&quot;text-wrap: wrap; box-sizing: border-box; margin-top: 32px; margin-bottom: 0.5em; color: rgb(64, 64, 64); text-rendering: optimizelegibility; font-size: 30px; word-break: break-word; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;解决XCode错误：Command PhaseScriptExecution failed with a nonzero exit code&lt;/h1&gt;&lt;div class=&quot;rEsl9f&quot; style=&quot;text-wrap: wrap; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; font-size: 13px; color: rgb(64, 64, 64); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;div class=&quot;_2mYfmT&quot; style=&quot;box-sizing: border-box; display: flex; align-items: center;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;一、环境&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;article class=&quot;_2rhmJa&quot; style=&quot;text-wrap: wrap; box-sizing: border-box; line-height: 1.8; margin-bottom: 20px; word-break: break-word; position: relative; color: rgb(64, 64, 64); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; word-break: break-word;&quot;&gt;XCode版本：14.3&lt;/p&gt;&lt;div class=&quot;image-package&quot; style=&quot;box-sizing: border-box; width: 866px; margin: 0px; padding-bottom: 25px; text-align: center; font-size: 0px;&quot;&gt;&lt;div class=&quot;image-container&quot; style=&quot;box-sizing: border-box; position: relative; z-index: 95; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 700px; max-height: 438px;&quot;&gt;&lt;div class=&quot;image-container-fill&quot; style=&quot;box-sizing: border-box; z-index: 90; padding-bottom: 290.359px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;image-view&quot; data-width=&quot;1056&quot; data-height=&quot;438&quot; style=&quot;box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 700px; height: 290.359px; overflow: hidden;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925214722172727204266975.png&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;image-caption&quot; style=&quot;box-sizing: border-box; min-width: 20%; max-width: 80%; min-height: 43px; display: inline-block; padding: 10px; margin: 0px auto; border-bottom: 1px solid rgb(238, 238, 238); font-size: 13px; color: rgb(153, 153, 153);&quot;&gt;image.png&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; word-break: break-word;&quot;&gt;二、错误场景信息&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;使用模拟器或真机调试、编译等都不出错，唯独在进行Archive时，会出现以下错误：&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot; style=&quot;box-sizing: border-box; position: relative; overflow: hidden;&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot; style=&quot;touch-action: manipulation; margin: 0px; color: rgb(204, 204, 204); font-size: 14px; font-family: inherit; line-height: inherit; overflow: visible; appearance: button; cursor: pointer; user-select: none; position: absolute; top: 6px; right: 6px; display: flex; justify-content: center; align-items: center; width: 32px; height: 24px; padding: 0px; border-width: initial; border-style: none; border-color: initial; border-radius: 6px; background-color: rgba(230, 230, 230, 0.2); box-shadow: rgba(0, 0, 0, 0.25) 0px 2px 0px 0px; opacity: 0; visibility: hidden; transition: opacity 0.2s ease-in-out 0s, visibility 0.2s ease-in-out 0s; z-index: 1;&quot;&gt;&lt;span aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot; style=&quot;box-sizing: border-box; display: inline-block; color: inherit; line-height: 0; vertical-align: -0.125em; text-rendering: optimizelegibility; -webkit-font-smoothing: antialiased;&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-bash&quot; style=&quot;box-sizing: border-box; font-size: 12px; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; margin-top: 0px; margin-bottom: 20px; overflow: scroll auto; overflow-wrap: normal; word-break: break-all; overscroll-behavior-x: contain; border-radius: 4px; z-index: 0; padding: 1em 1em 1em 3.8em; line-height: 1.5; color: rgb(204, 204, 204); background-color: rgb(45, 45, 45); word-spacing: normal; tab-size: 4; hyphens: none; position: relative; counter-reset: linenumber 0;&quot;&gt;Command&amp;nbsp;PhaseScriptExecution&amp;nbsp;failed&amp;nbsp;with&amp;nbsp;a&amp;nbsp;nonzero&amp;nbsp;exit&amp;nbsp;code&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; word-break: break-word;&quot;&gt;出错时的XCode截图如下：&lt;/p&gt;&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;&lt;div class=&quot;image-package&quot; style=&quot;box-sizing: border-box; width: 866px; margin: 0px; padding-bottom: 25px; text-align: center; font-size: 0px;&quot;&gt;&lt;div class=&quot;image-container&quot; style=&quot;box-sizing: border-box; position: relative; z-index: 95; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 700px; max-height: 320px;&quot;&gt;&lt;div class=&quot;image-container-fill&quot; style=&quot;box-sizing: border-box; z-index: 90; padding-bottom: 319.047px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;image-view&quot; data-width=&quot;2238&quot; data-height=&quot;1020&quot; style=&quot;box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 700px; height: 319.047px; overflow: hidden;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925214722172727204254618.png&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;image-caption&quot; style=&quot;box-sizing: border-box; min-width: 20%; max-width: 80%; min-height: 43px; display: inline-block; padding: 10px; margin: 0px auto; border-bottom: 1px solid rgb(238, 238, 238); font-size: 13px; color: rgb(153, 153, 153);&quot;&gt;image.png&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; word-break: break-word;&quot;&gt;三、解决方法&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;展开XCode左侧的项目结构目录，逐级展开“Pods” -&amp;gt; “Target Support Files” -&amp;gt; &amp;quot;Pods-项目名称&amp;quot;，打开其中的“Pods-项目名称-frameworks.sh”文件：&lt;/p&gt;&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;&lt;div class=&quot;image-package&quot; style=&quot;box-sizing: border-box; width: 866px; margin: 0px; padding-bottom: 25px; text-align: center; font-size: 0px;&quot;&gt;&lt;div class=&quot;image-container&quot; style=&quot;box-sizing: border-box; position: relative; z-index: 95; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 688px; max-height: 1112px;&quot;&gt;&lt;div class=&quot;image-container-fill&quot; style=&quot;box-sizing: border-box; z-index: 90; padding-bottom: 1091.98px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;image-view&quot; data-width=&quot;688&quot; data-height=&quot;1092&quot; style=&quot;box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 688px; height: 1091.98px; overflow: hidden;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925214722172727204264427.png&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;image-caption&quot; style=&quot;box-sizing: border-box; min-width: 20%; max-width: 80%; min-height: 43px; display: inline-block; padding: 10px; margin: 0px auto; border-bottom: 1px solid rgb(238, 238, 238); font-size: 13px; color: rgb(153, 153, 153);&quot;&gt;image.png&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; word-break: break-word;&quot;&gt;在该文件中，找到如下代码：&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot; style=&quot;box-sizing: border-box; position: relative; overflow: hidden;&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot; style=&quot;touch-action: manipulation; margin: 0px; color: rgb(204, 204, 204); font-size: 14px; font-family: inherit; line-height: inherit; overflow: visible; appearance: button; cursor: pointer; user-select: none; position: absolute; top: 6px; right: 6px; display: flex; justify-content: center; align-items: center; width: 32px; height: 24px; padding: 0px; border-width: initial; border-style: none; border-color: initial; border-radius: 6px; background-color: rgba(230, 230, 230, 0.2); box-shadow: rgba(0, 0, 0, 0.25) 0px 2px 0px 0px; opacity: 0; visibility: hidden; transition: opacity 0.2s ease-in-out 0s, visibility 0.2s ease-in-out 0s; z-index: 1;&quot;&gt;&lt;span aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot; style=&quot;box-sizing: border-box; display: inline-block; color: inherit; line-height: 0; vertical-align: -0.125em; text-rendering: optimizelegibility; -webkit-font-smoothing: antialiased;&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-bash&quot; style=&quot;box-sizing: border-box; font-size: 12px; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; margin-top: 0px; margin-bottom: 20px; overflow: scroll auto; overflow-wrap: normal; word-break: break-all; overscroll-behavior-x: contain; border-radius: 4px; z-index: 0; padding: 1em 1em 1em 3.8em; line-height: 1.5; color: rgb(204, 204, 204); background-color: rgb(45, 45, 45); word-spacing: normal; tab-size: 4; hyphens: none; position: relative; counter-reset: linenumber 0;&quot;&gt;source=&amp;quot;$(readlink&amp;nbsp;&amp;quot;${source}&amp;quot;)&amp;quot;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; word-break: break-word;&quot;&gt;把它 修改为：&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot; style=&quot;box-sizing: border-box; position: relative; overflow: hidden;&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot; style=&quot;touch-action: manipulation; margin: 0px; color: rgb(204, 204, 204); font-size: 14px; font-family: inherit; line-height: inherit; overflow: visible; appearance: button; cursor: pointer; user-select: none; position: absolute; top: 6px; right: 6px; display: flex; justify-content: center; align-items: center; width: 32px; height: 24px; padding: 0px; border-width: initial; border-style: none; border-color: initial; border-radius: 6px; background-color: rgba(230, 230, 230, 0.2); box-shadow: rgba(0, 0, 0, 0.25) 0px 2px 0px 0px; opacity: 0; visibility: hidden; transition: opacity 0.2s ease-in-out 0s, visibility 0.2s ease-in-out 0s; z-index: 1;&quot;&gt;&lt;span aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot; style=&quot;box-sizing: border-box; display: inline-block; color: inherit; line-height: 0; vertical-align: -0.125em; text-rendering: optimizelegibility; -webkit-font-smoothing: antialiased;&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-bash&quot; style=&quot;box-sizing: border-box; font-size: 12px; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; margin-top: 0px; margin-bottom: 20px; overflow: scroll auto; overflow-wrap: normal; word-break: break-all; overscroll-behavior-x: contain; border-radius: 4px; z-index: 0; padding: 1em 1em 1em 3.8em; line-height: 1.5; color: rgb(204, 204, 204); background-color: rgb(45, 45, 45); word-spacing: normal; tab-size: 4; hyphens: none; position: relative; counter-reset: linenumber 0;&quot;&gt;source=&amp;quot;$(readlink&amp;nbsp;-f&amp;nbsp;&amp;quot;${source}&amp;quot;)&amp;quot;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;image-package&quot; style=&quot;box-sizing: border-box; width: 866px; margin: 0px; padding-bottom: 25px; text-align: center; font-size: 0px;&quot;&gt;&lt;div class=&quot;image-container&quot; style=&quot;box-sizing: border-box; position: relative; z-index: 95; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 700px; max-height: 602px;&quot;&gt;&lt;div class=&quot;image-container-fill&quot; style=&quot;box-sizing: border-box; z-index: 90; padding-bottom: 381.703px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;image-view&quot; data-width=&quot;1104&quot; data-height=&quot;602&quot; style=&quot;box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 700px; height: 381.703px; overflow: hidden;&quot;&gt;&lt;img src=&quot;http://x.zx.cdqlx.top/zb_users/upload/2024/09/20240925214722172727204211415.png&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;image-caption&quot; style=&quot;box-sizing: border-box; min-width: 20%; max-width: 80%; min-height: 43px; display: inline-block; padding: 10px; margin: 0px auto; border-bottom: 1px solid rgb(238, 238, 238); font-size: 13px; color: rgb(153, 153, 153);&quot;&gt;image.png&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; word-break: break-word;&quot;&gt;完成后重新Archive即可。&lt;/p&gt;&lt;/article&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 25 Sep 2024 21:46:32 +0800</pubDate></item></channel></rss>