-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom.xml
165 lines (82 loc) · 44.3 KB
/
atom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Hexo</title>
<link href="http://example.com/atom.xml" rel="self"/>
<link href="http://example.com/"/>
<updated>2024-12-22T12:49:11.778Z</updated>
<id>http://example.com/</id>
<author>
<name>李蒙</name>
</author>
<generator uri="https://hexo.io/">Hexo</generator>
<entry>
<title>脚本快速重启Go项目</title>
<link href="http://example.com/2024/12/22/%E8%84%9A%E6%9C%AC%E5%BF%AB%E9%80%9F%E9%87%8D%E5%90%AFGo%E9%A1%B9%E7%9B%AE/"/>
<id>http://example.com/2024/12/22/%E8%84%9A%E6%9C%AC%E5%BF%AB%E9%80%9F%E9%87%8D%E5%90%AFGo%E9%A1%B9%E7%9B%AE/</id>
<published>2024-12-22T12:46:06.000Z</published>
<updated>2024-12-22T12:49:11.778Z</updated>
<content type="html"><![CDATA[<p>创建restart.sh</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">pid=$(netstat -nlp|grep 8080|awk '{print $7}'|awk -F "/" '{ print $1 }');</span><br><span class="line">echo "example used pid=${pid}"</span><br><span class="line"></span><br><span class="line">if [ -n "${pid}" ]; then</span><br><span class="line"> kill -9 ${pid};</span><br><span class="line">fi</span><br><span class="line"></span><br><span class="line">chmod +x example</span><br><span class="line">nohup ./example >log 2>&1 &</span><br></pre></td></tr></table></figure><p>执行命令 chmod +x restart.sh 来赋予脚本执行权限<br>重启命令 sh restart.sh</p>]]></content>
<summary type="html"><p>创建restart.sh</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line"</summary>
<category term="server" scheme="http://example.com/categories/server/"/>
<category term="go" scheme="http://example.com/tags/go/"/>
</entry>
<entry>
<title>日常操作主要是以下几个</title>
<link href="http://example.com/2024/12/11/hello-world/"/>
<id>http://example.com/2024/12/11/hello-world/</id>
<published>2024-12-11T06:27:35.141Z</published>
<updated>2024-12-11T07:59:32.463Z</updated>
<content type="html"><![CDATA[<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">#发布新文章</span><br><span class="line">hexo new 文件名</span><br><span class="line"></span><br><span class="line">#预览</span><br><span class="line">hexo s</span><br><span class="line"></span><br><span class="line">#生成文件到 public 目录</span><br><span class="line">hexo g</span><br><span class="line"></span><br><span class="line">#发布到 Github Pages</span><br><span class="line">hexo d</span><br></pre></td></tr></table></figure><p>需要注意,如果改了文件发布的话,要先 hexo g,然后再 hexo d。</p>]]></content>
<summary type="html"><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span c</summary>
</entry>
<entry>
<title>内购中断此测试员的购买流程</title>
<link href="http://example.com/2020/09/10/%E5%86%85%E8%B4%AD%E4%B8%AD%E6%96%AD%E6%AD%A4%E6%B5%8B%E8%AF%95%E5%91%98%E7%9A%84%E8%B4%AD%E4%B9%B0%E6%B5%81%E7%A8%8B/"/>
<id>http://example.com/2020/09/10/%E5%86%85%E8%B4%AD%E4%B8%AD%E6%96%AD%E6%AD%A4%E6%B5%8B%E8%AF%95%E5%91%98%E7%9A%84%E8%B4%AD%E4%B9%B0%E6%B5%81%E7%A8%8B/</id>
<published>2020-09-10T03:10:31.000Z</published>
<updated>2024-12-11T06:27:35.141Z</updated>
<content type="html"><![CDATA[<p>中断此测试员的购买流程<br>此测试员在沙盒环境中于设备上进行的购买尝试将被更新的条款与条件中断。此功能可以测试 App 对中断情况的响应,以确保购买流程顺畅。<br>在此流程中,测试员的购买尝试将被中断,除非您取消选中上方的复选框,或测试员在其 iOS 设备上同意条款与条件。</p><p>点 “取消” 和 点 “好” 都会报错:<br>source:IAPSource.AppStore<br>code:purchase_error<br>message:SKErrorDomain<br>details:{NSLocalizedDescription: 发生未知错误, NSUnderlyingError: {domain: ASDServerErrorDomain, userInfo: {NSLocalizedDescription: Apple 媒體服務條款與約定已更改}, code: 3038}}</p><p>同意协议后,走回调票据 进入 PurchaseStatus.purchased 状态</p>]]></content>
<summary type="html"><p>中断此测试员的购买流程<br>此测试员在沙盒环境中于设备上进行的购买尝试将被更新的条款与条件中断。此功能可以测试 App 对中断情况的响应,以确保购买流程顺畅。<br>在此流程中,测试员的购买尝试将被中断,除非您取消选中上方的复选框,或测试员在其 iOS 设备上同意条款与条</summary>
<category term="app" scheme="http://example.com/categories/app/"/>
<category term="flutter" scheme="http://example.com/tags/flutter/"/>
</entry>
<entry>
<title>flutter一键打包ipa、apk安装包 上传蒲公英</title>
<link href="http://example.com/2020/06/22/flutter%E4%B8%80%E9%94%AE%E6%89%93%E5%8C%85ipa%E3%80%81apk%E5%AE%89%E8%A3%85%E5%8C%85/"/>
<id>http://example.com/2020/06/22/flutter%E4%B8%80%E9%94%AE%E6%89%93%E5%8C%85ipa%E3%80%81apk%E5%AE%89%E8%A3%85%E5%8C%85/</id>
<published>2020-06-22T12:44:05.000Z</published>
<updated>2024-12-11T06:27:35.141Z</updated>
<content type="html"><![CDATA[<p>经验证,flutter build iOS打出的ipa包太大,用xcodebuild打包正常,支持设置代码混淆。iOS如果因为签名原因打包失败,先用Xcode正常打一次就行。</p><p>直接上脚本:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">## 计时</span></span><br><span class="line">SECONDS=0</span><br><span class="line"></span><br><span class="line"><span class="comment"># 打包类型 1:android 2:ios any:其它全部</span></span><br><span class="line">platform=0</span><br><span class="line"></span><br><span class="line"><span class="comment"># Xcode12开始需要设置导出ipa的名字</span></span><br><span class="line">project_name=<span class="string">"flutter_easy_example"</span></span><br><span class="line"><span class="comment">## 蒲公英 APIKey https://www.pgyer.com/account/api</span></span><br><span class="line">pgyer_api_key=<span class="string">""</span></span><br><span class="line"><span class="comment">## 蒲公英 下载地址后缀</span></span><br><span class="line">pgyer_subfix_url=<span class="string">""</span></span><br><span class="line"><span class="comment">## 蒲公英 安装密码</span></span><br><span class="line">pgyer_pwd=<span class="string">""</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 不使用代码混淆</span></span><br><span class="line"><span class="comment">#obfuscate=""</span></span><br><span class="line"><span class="comment"># 开启代码混淆</span></span><br><span class="line">obfuscate=<span class="string">"--obfuscate --split-debug-info=app"</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 选择打包类型</span></span><br><span class="line"><span class="built_in">read</span> -n1 -p <span class="string">"设置打包类型 1:android 2:ios any:其它全部 (5s后自动执全部打包) [1/2/any]? "</span> -t 5 answer</span><br><span class="line">platform=<span class="variable">${answer}</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"清理 build"</span></span><br><span class="line">find . -d -name <span class="string">"build"</span> | xargs <span class="built_in">rm</span> -rf</span><br><span class="line">flutter clean</span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"开始获取 packages 插件资源"</span></span><br><span class="line">flutter packages get</span><br><span class="line"></span><br><span class="line"><span class="comment"># iOS</span></span><br><span class="line"><span class="function"><span class="title">build_ios</span></span>() {</span><br><span class="line"><span class="built_in">cd</span> ios</span><br><span class="line">project=`find . -name *.xcodeproj | awk -F <span class="string">"[/.]"</span> <span class="string">'{print $(NF-1)}'</span>`</span><br><span class="line"></span><br><span class="line"><span class="comment">## true or false 默认true</span></span><br><span class="line">workspace_flag=<span class="string">"true"</span></span><br><span class="line"></span><br><span class="line"><span class="comment">## Release or Debug 默认Release</span></span><br><span class="line">configuration=<span class="string">"Release"</span></span><br><span class="line"></span><br><span class="line"><span class="comment">## Bitcode开关 默认打开</span></span><br><span class="line">compileBitcode=<span class="literal">true</span></span><br><span class="line"></span><br><span class="line"><span class="comment">## 签名方式 默认自动签名,如果打包失败,先用Xcode打一次就正常了</span></span><br><span class="line">signingStyle=<span class="string">"automatic"</span></span><br><span class="line"></span><br><span class="line"><span class="comment">## 签名方式</span></span><br><span class="line"><span class="comment">### development</span></span><br><span class="line"><span class="comment">### ad-hoc</span></span><br><span class="line"><span class="comment">### app-store</span></span><br><span class="line"><span class="comment">### enterprise</span></span><br><span class="line">methodStyle=<span class="string">"ad-hoc"</span></span><br><span class="line"></span><br><span class="line"><span class="comment">## 打包导出目录</span></span><br><span class="line">path_app=<span class="string">"../app"</span></span><br><span class="line"></span><br><span class="line"><span class="comment">## 工作目录 build目录在.gitignore添加忽略</span></span><br><span class="line">path_build=<span class="string">"build"</span></span><br><span class="line"></span><br><span class="line">path_archive=<span class="string">"<span class="variable">${path_build}</span>/<span class="variable">${project}</span>.xcarchive"</span></span><br><span class="line"></span><br><span class="line">path_export_options=<span class="string">"<span class="variable">${path_build}</span>/ExportOptions.plist"</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> [ -d <span class="string">"<span class="variable">${path_build}</span>"</span> ]</span><br><span class="line"><span class="keyword">then</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"目录<span class="variable">${path_build}</span>已存在"</span></span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"创建目录<span class="variable">${path_build}</span>"</span></span><br><span class="line"> <span class="built_in">mkdir</span> -pv <span class="string">"<span class="variable">${path_build}</span>"</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="title">funcExpertOptionFile</span></span>() {</span><br><span class="line"> <span class="keyword">if</span> [ -f <span class="string">"<span class="variable">$path_export_options</span>"</span> ]</span><br><span class="line"> <span class="keyword">then</span></span><br><span class="line"> <span class="built_in">rm</span> -rf <span class="string">"<span class="variable">$path_export_options</span>"</span></span><br><span class="line"> <span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line"> /usr/libexec/PlistBuddy -c <span class="string">"Add :compileBitcode bool <span class="variable">$compileBitcode</span>"</span> <span class="string">"<span class="variable">$path_export_options</span>"</span></span><br><span class="line"> /usr/libexec/PlistBuddy -c <span class="string">"Add :signingStyle string <span class="variable">$signingStyle</span>"</span> <span class="string">"<span class="variable">$path_export_options</span>"</span></span><br><span class="line"> /usr/libexec/PlistBuddy -c <span class="string">"Add :method string <span class="variable">$methodStyle</span>"</span> <span class="string">"<span class="variable">$path_export_options</span>"</span></span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">## 创建ExportOptions.plist文件</span></span><br><span class="line">funcExpertOptionFile</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> <span class="variable">$workspace_flag</span></span><br><span class="line"><span class="keyword">then</span></span><br><span class="line"> <span class="comment">## 清理工程</span></span><br><span class="line"> xcodebuild clean -workspace <span class="variable">${project}</span>.xcworkspace \</span><br><span class="line"> -scheme <span class="variable">${project}</span> \</span><br><span class="line"> -configuration <span class="variable">${configuration}</span></span><br><span class="line"></span><br><span class="line"> <span class="comment">## 归档</span></span><br><span class="line"> xcodebuild archive -workspace <span class="variable">${project}</span>.xcworkspace \</span><br><span class="line"> -scheme <span class="variable">${project}</span> \</span><br><span class="line"> -configuration <span class="variable">${configuration}</span> \</span><br><span class="line"> -archivePath <span class="variable">${path_archive}</span></span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"> <span class="comment">## 清理工程</span></span><br><span class="line"> xcodebuild clean -project <span class="variable">${project}</span>.xcworkspace \</span><br><span class="line"> -scheme <span class="variable">${project}</span> \</span><br><span class="line"> -configuration <span class="variable">${configuration}</span></span><br><span class="line"></span><br><span class="line"> <span class="comment">## 归档</span></span><br><span class="line"> xcodebuild archive -project <span class="variable">${project}</span>.xcworkspace \</span><br><span class="line"> -scheme <span class="variable">${project}</span> \</span><br><span class="line"> -configuration <span class="variable">${configuration}</span> \</span><br><span class="line"> -archivePath <span class="variable">${path_archive}</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line"><span class="comment">## 判断归档结果</span></span><br><span class="line"><span class="keyword">if</span> [ -d <span class="string">"<span class="variable">${path_archive}</span>"</span> ]</span><br><span class="line"><span class="keyword">then</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"** Finished archive. Elapsed time: <span class="variable">${SECONDS}</span>s **"</span></span><br><span class="line"> <span class="built_in">echo</span></span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"> <span class="built_in">exit</span> 1</span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line"><span class="comment">## 导出ipa</span></span><br><span class="line">xcodebuild -exportArchive \</span><br><span class="line">-archivePath <span class="variable">${path_archive}</span> \</span><br><span class="line">-exportPath <span class="variable">${path_app}</span> \</span><br><span class="line">-exportOptionsPlist <span class="variable">${path_export_options}</span></span><br><span class="line"></span><br><span class="line"><span class="comment">## ipa路径</span></span><br><span class="line">file_ipa=<span class="string">"<span class="variable">${path_app}</span>/<span class="variable">${project}</span>-<span class="subst">$(date <span class="string">"+%Y%m%d%H%M"</span>)</span>.ipa"</span></span><br><span class="line"><span class="keyword">if</span> [[ -n <span class="string">"<span class="variable">${project_name}</span>"</span> ]]</span><br><span class="line"> <span class="keyword">then</span></span><br><span class="line"> <span class="built_in">mv</span> <span class="string">"<span class="variable">${path_app}</span>/<span class="variable">${project_name}</span>.ipa"</span> <span class="string">"<span class="variable">${file_ipa}</span>"</span></span><br><span class="line"> <span class="keyword">else</span></span><br><span class="line"> <span class="built_in">mv</span> <span class="string">"<span class="variable">${path_app}</span>/<span class="variable">${project}</span>.ipa"</span> <span class="string">"<span class="variable">${file_ipa}</span>"</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line"><span class="comment">## 判断导出ipa结果</span></span><br><span class="line"><span class="keyword">if</span> [ -f <span class="string">"<span class="variable">${file_ipa}</span>"</span> ]</span><br><span class="line"><span class="keyword">then</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"** Finished export. Elapsed time: <span class="variable">${SECONDS}</span>s **"</span></span><br><span class="line"> <span class="built_in">rm</span> -rf <span class="string">"<span class="variable">$path_build</span>"</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="variable">$file_ipa</span></span><br><span class="line"> say <span class="string">"iOS打包成功"</span></span><br><span class="line"></span><br><span class="line"> <span class="keyword">if</span> [[ -n <span class="string">"<span class="variable">${pgyer_api_key}</span>"</span> ]]</span><br><span class="line"> <span class="keyword">then</span></span><br><span class="line"> <span class="comment">#上传到pgyer</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"正在上传到蒲公英..."</span></span><br><span class="line"> <span class="built_in">echo</span></span><br><span class="line"> curl -F <span class="string">"file=@<span class="variable">${file_ipa}</span>"</span> -F <span class="string">"_api_key=<span class="variable">${pgyer_api_key}</span>"</span> -F <span class="string">"buildInstallType=2"</span> -F <span class="string">"buildPassword=<span class="variable">${pgyer_pwd}</span>"</span> -F <span class="string">"buildUpdateDescription=脚本自动上传"</span> https://www.pgyer.com/apiv2/app/upload</span><br><span class="line"> <span class="comment"># rm -rf ${file_ipa}</span></span><br><span class="line"> <span class="built_in">echo</span></span><br><span class="line"> say <span class="string">"iOS上传蒲公英成功"</span></span><br><span class="line"> <span class="built_in">echo</span></span><br><span class="line"> <span class="keyword">if</span> [[ -n <span class="string">"<span class="variable">${pgyer_subfix_url}</span>"</span> ]]</span><br><span class="line"> <span class="keyword">then</span></span><br><span class="line"> open https://www.pgyer.com/<span class="variable">${pgyer_subfix_url}</span></span><br><span class="line"> <span class="keyword">fi</span></span><br><span class="line"> <span class="keyword">else</span></span><br><span class="line"> open <span class="variable">$path_app</span></span><br><span class="line"> <span class="keyword">fi</span></span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"遇到报错了😭, 打开Xcode查找错误原因"</span></span><br><span class="line"> say <span class="string">"iOS打包失败"</span></span><br><span class="line"> <span class="built_in">exit</span> 1</span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"------------------------------------------------------------------------------"</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"🎉 Congrats"</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"🚀 <span class="variable">${project}</span> successfully published"</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"📅 Finished. Elapsed time: <span class="variable">${SECONDS}</span>s"</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"🌎 https://octmon.github.io"</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"👍 Tell your friends!"</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"------------------------------------------------------------------------------"</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">cd</span> ..</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">##==================================apk==================================</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="variable">${platform}</span> -ne 2 ]]; <span class="keyword">then</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"开始build apk"</span></span><br><span class="line"> flutter build apk <span class="variable">$obfuscate</span> --release --verbose <span class="comment">#--no-codesign</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"build apk已完成"</span></span><br><span class="line"></span><br><span class="line"> file_apk=android-$(<span class="built_in">date</span> <span class="string">"+%Y%m%d%H%M"</span>).apk</span><br><span class="line"></span><br><span class="line"> <span class="built_in">cp</span> -r build/app/outputs/apk/release/app-release.apk app/<span class="variable">$file_apk</span></span><br><span class="line"></span><br><span class="line"> <span class="keyword">if</span> [[ -f app/<span class="variable">${file_apk}</span> ]]</span><br><span class="line"> <span class="keyword">then</span></span><br><span class="line"> say <span class="string">"android打包成功"</span></span><br><span class="line"></span><br><span class="line"> <span class="keyword">if</span> [[ -n <span class="string">"<span class="variable">${pgyer_api_key}</span>"</span> ]]</span><br><span class="line"> <span class="keyword">then</span></span><br><span class="line"> <span class="comment">#上传到pgyer</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"正在上传到蒲公英..."</span></span><br><span class="line"> <span class="built_in">echo</span></span><br><span class="line"> curl -F <span class="string">"file=@app/<span class="variable">${file_apk}</span>"</span> -F <span class="string">"_api_key=<span class="variable">${pgyer_api_key}</span>"</span> -F <span class="string">"buildInstallType=2"</span> -F <span class="string">"buildPassword=<span class="variable">${pgyer_pwd}</span>"</span> -F <span class="string">"buildUpdateDescription=脚本自动上传"</span> https://www.pgyer.com/apiv2/app/upload</span><br><span class="line"> <span class="comment"># rm -rf app/${file_ipa}</span></span><br><span class="line"> <span class="built_in">echo</span></span><br><span class="line"> say <span class="string">"android上传蒲公英成功"</span></span><br><span class="line"> <span class="built_in">echo</span></span><br><span class="line"> <span class="keyword">if</span> [[ -n <span class="string">"<span class="variable">${pgyer_subfix_url}</span>"</span> ]]</span><br><span class="line"> <span class="keyword">then</span></span><br><span class="line"> open https://www.pgyer.com/<span class="variable">${pgyer_subfix_url}</span></span><br><span class="line"> <span class="keyword">fi</span></span><br><span class="line"> <span class="keyword">else</span></span><br><span class="line"> open app</span><br><span class="line"> <span class="keyword">fi</span></span><br><span class="line"> <span class="keyword">else</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"遇到报错了😭, 打开Android Studio查找错误原因"</span></span><br><span class="line"> say <span class="string">"android打包失败"</span></span><br><span class="line"> <span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"📅 Finished. Elapsed time: <span class="variable">${SECONDS}</span>s"</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="comment">##==================================apk==================================</span></span><br><span class="line"></span><br><span class="line"><span class="comment">##==================================ipa==================================</span></span><br><span class="line"><span class="keyword">if</span> [[ <span class="variable">${platform}</span> -ne 1 ]]; <span class="keyword">then</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"开始build ios"</span></span><br><span class="line"> flutter build ios <span class="variable">$obfuscate</span> --release --verbose <span class="comment">#--no-codesign</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"build ios已完成"</span></span><br><span class="line"></span><br><span class="line"> build_ios</span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="comment">##==================================ipa==================================</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><p>经验证,flutter build iOS打出的ipa包太大,用xcodebuild打包正常,支持设置代码混淆。iOS如果因为签名原因打包失败,先用Xcode正常打一次就行。</p>
<p>直接上脚本:</p>
<figure class="highlight bash"></summary>
<category term="app" scheme="http://example.com/categories/app/"/>
<category term="flutter" scheme="http://example.com/tags/flutter/"/>
</entry>
<entry>
<title>flutter配置多个环境</title>
<link href="http://example.com/2020/06/10/flutter%E9%85%8D%E7%BD%AE%E5%A4%9A%E4%B8%AA%E7%8E%AF%E5%A2%83/"/>
<id>http://example.com/2020/06/10/flutter%E9%85%8D%E7%BD%AE%E5%A4%9A%E4%B8%AA%E7%8E%AF%E5%A2%83/</id>
<published>2020-06-10T13:37:50.000Z</published>
<updated>2024-12-11T06:27:35.141Z</updated>
<content type="html"><![CDATA[<p>复制一份默认的flutter环境,并修改文件夹为:flutter_dev</p><p>打开终端输入:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">open .zshrc </span><br></pre></td></tr></table></figure><p>在文本编辑里加入flutter_dev环境:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">export</span> PATH=<span class="variable">$PATH</span>:~/Library/Android/sdk/platform-tools;</span><br><span class="line"><span class="built_in">export</span> PATH=~/Library/Android/flutter/bin:<span class="variable">$PATH</span></span><br><span class="line"><span class="built_in">export</span> PUB_HOSTED_URL=https://pub.flutter-io.cn </span><br><span class="line"><span class="built_in">export</span> FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn</span><br><span class="line"></span><br><span class="line"><span class="built_in">alias</span> flutter_dev=~/Library/Android/flutter_dev/bin/flutter</span><br></pre></td></tr></table></figure><p>保存之后,新建Shell窗口验证默认flutter环境,输入:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">flutter doctor</span><br></pre></td></tr></table></figure><p>结果:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">Doctor summary (to see all details, run flutter doctor -v):</span><br><span class="line">[✓] Flutter (Channel stable, v1.12.13+hotfix.10-pre.1, on Mac OS X 10.15.5</span><br><span class="line"> 19F101, locale zh-Hans-CN)</span><br><span class="line">[✓] Android toolchain - develop <span class="keyword">for</span> Android devices (Android SDK version 29.0.3)</span><br><span class="line">[✓] Xcode - develop <span class="keyword">for</span> iOS and macOS (Xcode 11.4.1)</span><br><span class="line">[✓] Android Studio (version 4.0)</span><br><span class="line">[✓] VS Code (version 1.45.1)</span><br><span class="line">[✓] Connected device (1 available)</span><br><span class="line"></span><br><span class="line">• No issues found!</span><br></pre></td></tr></table></figure><p>验证flutter_dev环境,输入:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">flutter_dev doctor</span><br></pre></td></tr></table></figure><p>结果:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">[✓] Flutter (Channel dev, 1.19.0-3.0.pre, on Mac OS X 10.15.5 19F101, locale</span><br><span class="line"> zh-Hans-CN)</span><br><span class="line"> </span><br><span class="line">[✓] Android toolchain - develop <span class="keyword">for</span> Android devices (Android SDK version 29.0.3)</span><br><span class="line">[✓] Xcode - develop <span class="keyword">for</span> iOS and macOS (Xcode 11.4.1)</span><br><span class="line">[✓] Chrome - develop <span class="keyword">for</span> the web</span><br><span class="line">[✓] Android Studio (version 4.0)</span><br><span class="line">[✓] VS Code (version 1.45.1)</span><br><span class="line">[✓] Connected device (4 available)</span><br><span class="line"></span><br><span class="line">• No issues found!</span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><p>复制一份默认的flutter环境,并修改文件夹为:flutter_dev</p>
<p>打开终端输入:</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="li</summary>
<category term="app" scheme="http://example.com/categories/app/"/>
<category term="flutter" scheme="http://example.com/tags/flutter/"/>
</entry>
<entry>
<title>flutter中使用 Future.wait 一次执行多个异步操作</title>
<link href="http://example.com/2020/06/09/Flutter%E4%B8%AD%E4%BD%BF%E7%94%A8-Future-wait-%E4%B8%80%E6%AC%A1%E6%89%A7%E8%A1%8C%E5%A4%9A%E4%B8%AA%E5%BC%82%E6%AD%A5%E6%93%8D%E4%BD%9C/"/>
<id>http://example.com/2020/06/09/Flutter%E4%B8%AD%E4%BD%BF%E7%94%A8-Future-wait-%E4%B8%80%E6%AC%A1%E6%89%A7%E8%A1%8C%E5%A4%9A%E4%B8%AA%E5%BC%82%E6%AD%A5%E6%93%8D%E4%BD%9C/</id>
<published>2020-06-09T03:09:28.000Z</published>
<updated>2024-12-11T06:27:35.141Z</updated>
<content type="html"><![CDATA[<p>用法:</p><figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">Future.wait([</span><br><span class="line"> PackageInfoUtil.init(),</span><br><span class="line"> SharedPreferencesUtil.init(),</span><br><span class="line">]).then((e) {</span><br><span class="line"> log(<span class="string">"init:"</span>, e);</span><br><span class="line"> callback();</span><br><span class="line">});</span><br></pre></td></tr></table></figure><p>执行结果:</p><figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">flutter: init: => [Instance of <span class="string">'PackageInfo'</span>, Instance of <span class="string">'SharedPreferences'</span>]</span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><p>用法:</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><</summary>
<category term="app" scheme="http://example.com/categories/app/"/>
<category term="flutter" scheme="http://example.com/tags/flutter/"/>
</entry>
</feed>