-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatom.xml
1246 lines (1151 loc) · 174 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>郭艳军的那些事儿</title>
<subtitle>๑۩ﺴ 透过指尖目视锦瑟流年,邂逅一场繁华的悸动 ﺴ۩๑</subtitle>
<link href="/blog/atom.xml" rel="self"/>
<link href="http://guoyanjun.top/"/>
<updated>2020-07-07T08:37:42.128Z</updated>
<id>http://guoyanjun.top/</id>
<author>
<name>一月筠</name>
</author>
<generator uri="http://hexo.io/">Hexo</generator>
<entry>
<title>iOS蓝牙开发(一)蓝牙相关基础知识</title>
<link href="http://guoyanjun.top/2017/05/26/ios-bluetoth-development-(1)-bluetoth-related-basic-knowledge.html"/>
<id>http://guoyanjun.top/2017/05/26/ios-bluetoth-development-(1)-bluetoth-related-basic-knowledge.html</id>
<published>2017-05-26T04:55:30.000Z</published>
<updated>2020-07-07T08:37:42.128Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/blog/assets/css/APlayer.min.css"><script src="/blog/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="/blog/assets/js/Meting.min.js"></script><ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li>CoreBluetooth框架的核心其实是两个东西,peripheral和central, 可以理解成外设和中心。对应他们分别有一组相关的API和类…<a id="more"></a>
</li>
</ul>
<h2 id="蓝牙常见名称和缩写"><a href="#蓝牙常见名称和缩写" class="headerlink" title="蓝牙常见名称和缩写"></a>蓝牙常见名称和缩写</h2><ul>
<li>MFI ======= make for ipad ,iphone, itouch 专们为苹果设备制作的设备</li>
<li>BLE ==== buletouch low energy,蓝牙4.0设备因为低耗电,所以也叫做BLE</li>
<li>peripheral,central == 外设和中心,发起连接的时central,被连接的设备为perilheral</li>
<li>service and characteristic === 服务和特征 每个设备会提供服务和特征,类似于服务端的api,但是机构不同。每个外设会有很多服务,每个服务中包含很多字段,这些字段的权限一般分为 读read,写write,通知notiy几种,就是我们连接设备后具体需要操作的内容。</li>
<li>Description 每个characteristic可以对应一个或多个Description用户描述characteristic的信息或属性</li>
<li>MFI === 开发使用ExternalAccessory 框架</li>
<li>4.0 BLE === 开发使用CoreBluetooth 框架</li>
</ul>
<h2 id="蓝牙基础知识"><a href="#蓝牙基础知识" class="headerlink" title="蓝牙基础知识"></a>蓝牙基础知识</h2><blockquote>
<p>CoreBluetooth框架的核心其实是两个东西,peripheral和central, 可以理解成外设和中心。对应他们分别有一组相关的API和类</p>
</blockquote>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-26/b3c9e674fc4668e8824ab3885d5e54c8/1819713-e61619a0ccf8df53.jpeg" alt="示例图1"></p>
<ul>
<li>这两组api分别对应不同的业务场景,左侧叫做中心模式,就是以你的app作为中心,连接其他的外设的场景,而右侧称为外设模式,使用手机作为外设别其他中心设备操作的场景。</li>
<li>服务和特征,特征的属性(service and characteristic):<br>每个设备都会有一些服务,每个服务里面都会有一些特征,特征就是具体键值对,提供数据的地方。每个特征属性分为这么几种:读,写,通知这么几种方式。</li>
</ul>
<figure class="highlight objc"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div></pre></td><td class="code"><pre><div class="line"><span class="comment">//objcetive c特征的定义枚举</span></div><div class="line"> <span class="keyword">typedef</span> <span class="built_in">NS_OPTIONS</span>(<span class="built_in">NSUInteger</span>, CBCharacteristicProperties) {</div><div class="line"> CBCharacteristicPropertyBroadcast = <span class="number">0x01</span>,</div><div class="line"> CBCharacteristicPropertyRead = <span class="number">0x02</span>,</div><div class="line"> CBCharacteristicPropertyWriteWithoutResponse = <span class="number">0x04</span>,</div><div class="line"> CBCharacteristicPropertyWrite = <span class="number">0x08</span>,</div><div class="line"> CBCharacteristicPropertyNotify = <span class="number">0x10</span>,</div><div class="line"> CBCharacteristicPropertyIndicate = <span class="number">0x20</span>,</div><div class="line"> CBCharacteristicPropertyAuthenticatedSignedWrites = <span class="number">0x40</span>,</div><div class="line"> CBCharacteristicPropertyExtendedProperties = <span class="number">0x80</span>,</div><div class="line"> CBCharacteristicPropertyNotifyEncryptionRequired <span class="built_in">NS_ENUM_AVAILABLE</span>(NA, <span class="number">6</span>_0) = <span class="number">0x100</span>,</div><div class="line"> CBCharacteristicPropertyIndicateEncryptionRequired <span class="built_in">NS_ENUM_AVAILABLE</span>(NA, <span class="number">6</span>_0) = <span class="number">0x200</span></div><div class="line"> };</div></pre></td></tr></table></figure>
<p>外设、服务、特征间的关系<br><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-26/b3c9e674fc4668e8824ab3885d5e54c8/1819713-8d7a032f36ab3602.png" alt="示例图2"></p>
<h2 id="蓝牙中心模式流程"><a href="#蓝牙中心模式流程" class="headerlink" title="蓝牙中心模式流程"></a>蓝牙中心模式流程</h2><figure class="highlight lsl"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line"><span class="number">1.</span> 建立中心角色</div><div class="line"><span class="number">2.</span> 扫描外设(discover)</div><div class="line"><span class="number">3.</span> 连接外设(connect)</div><div class="line"><span class="number">4.</span> 扫描外设中的服务和特征(discover)</div><div class="line"> - <span class="number">4.1</span> 获取外设的services</div><div class="line"> - <span class="number">4.2</span> 获取外设的Characteristics,获取Characteristics的值,获取Characteristics的Descriptor和Descriptor的值</div><div class="line"><span class="number">5.</span> 与外设做数据交互(explore and interact)</div><div class="line"><span class="number">6.</span> 订阅Characteristic的通知</div><div class="line"><span class="number">7.</span> 断开连接(disconnect)</div></pre></td></tr></table></figure>
<h2 id="蓝牙外设模式流程"><a href="#蓝牙外设模式流程" class="headerlink" title="蓝牙外设模式流程"></a>蓝牙外设模式流程</h2><figure class="highlight markdown"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="bullet">1. </span>启动一个Peripheral管理对象</div><div class="line"><span class="bullet">2. </span>本地Peripheral设置服务,特性,描述,权限等等</div><div class="line"><span class="bullet">3. </span>Peripheral发送广告</div><div class="line"><span class="bullet">4. </span>设置处理订阅、取消订阅、读characteristic、写characteristic的委托方法</div></pre></td></tr></table></figure>
<h2 id="蓝牙设备状态"><a href="#蓝牙设备状态" class="headerlink" title="蓝牙设备状态"></a>蓝牙设备状态</h2><figure class="highlight markdown"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line"><span class="bullet">1. </span>待机状态(standby):设备没有传输和发送数据,并且没有连接到任何设</div><div class="line"><span class="bullet">2. </span>广播状态(Advertiser):周期性广播状态</div><div class="line"><span class="bullet">3. </span>扫描状态(Scanner):主动寻找正在广播的设备</div><div class="line"><span class="bullet">4. </span>发起链接状态(Initiator):主动向扫描设备发起连接。</div><div class="line"><span class="bullet">5. </span>主设备(Master):作为主设备连接到其他设备。</div><div class="line"><span class="bullet">6. </span>从设备(Slave):作为从设备连接到其他设备。</div></pre></td></tr></table></figure>
<h2 id="蓝牙设备的五种工作状态"><a href="#蓝牙设备的五种工作状态" class="headerlink" title="蓝牙设备的五种工作状态"></a>蓝牙设备的五种工作状态</h2><ul>
<li>准备(standby)</li>
<li>广播(advertising)</li>
<li>监听扫描(Scanning)</li>
<li>发起连接(Initiating)</li>
<li>已连接(Connected)</li>
</ul>
<h2 id="蓝牙和版本的使用限制"><a href="#蓝牙和版本的使用限制" class="headerlink" title="蓝牙和版本的使用限制"></a>蓝牙和版本的使用限制</h2><ul>
<li>蓝牙2.0 === 越狱设备</li>
<li>蓝牙4.0 === IOS6 以上</li>
<li>MFI认证设备(Make For ipod/ipad/iphone) === 无限制</li>
</ul>
<h2 id="名词解释"><a href="#名词解释" class="headerlink" title="名词解释"></a>名词解释</h2><ul>
<li>GAAT : Generic Attribute Profile , GATT配置文件是一个通用规范,用于在BLE链路上发送和接收被称为“属性”的数据块。目前所有的BLE应用都基于GATT。 蓝牙SIG规定了许多低功耗设备的配置文件。配置文件是设备如何在特定的应用程序中工作的规格说明。注意一个设备可以实现多个配置文件。例如,一个设备可能包括心率监测仪和电量检测。</li>
<li>Characteristic 一个characteristic包括一个单一变量和0-n个用来描述characteristic变量的descriptor,characteristic可以被认为是一个类型,类 似于类。</li>
<li>Descriptor Descriptor用来描述characteristic变量的属性。例如,一个descriptor可以规定一个可读的描述,或者一个characteristic变量可接受的范围,或者一个characteristic变量特定的测量单位。 Service service是characteristic的集合。例如,你可能有一个叫“Heart Rate Monitor(心率监测仪)”的service,它包括了很多characteristics,如“heart rate measurement(心率测量)”等。你可以在bluetooth.org 找到一个目前支持的基于GATT的配置文件和服务列表。</li>
</ul>
<h2 id="参考阅读"><a href="#参考阅读" class="headerlink" title="参考阅读"></a>参考阅读</h2><p><a href="http://www.race604.com/gatt-profile-intro/" target="_blank" rel="external">GATT Profile简介</a></p>
<p>本文转载自:<a href="http://liuyanwei.jumppo.com/" target="_blank" rel="external">http://liuyanwei.jumppo.com/</a></p>
]]></content>
<summary type="html">
<ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li>CoreBluetooth框架的核心其实是两个东西,peripheral和central, 可以理解成外设和中心。对应他们分别有一组相关的API和类…
</summary>
<category term="术业专攻" scheme="http://guoyanjun.top/categories/%E6%9C%AF%E4%B8%9A%E4%B8%93%E6%94%BB/"/>
<category term="iOS" scheme="http://guoyanjun.top/tags/iOS/"/>
</entry>
<entry>
<title>Mac版 IntelliJ IDEA 创建Web项目并部署servlet</title>
<link href="http://guoyanjun.top/2017/05/21/the-mac-version-of-intelij-idea-creates-the-web-project-and-deploys-the-servlet.html"/>
<id>http://guoyanjun.top/2017/05/21/the-mac-version-of-intelij-idea-creates-the-web-project-and-deploys-the-servlet.html</id>
<published>2017-05-21T04:30:30.000Z</published>
<updated>2020-07-06T07:57:19.198Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/blog/assets/css/APlayer.min.css"><script src="/blog/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="/blog/assets/js/Meting.min.js"></script><ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li><code>File</code> -> <code>New Project</code> -> 选择<code>Project SDK</code>为1.8 -> <code>Next</code>…<a id="more"></a>
</li>
</ul>
<h2 id="创建一个web项目"><a href="#创建一个web项目" class="headerlink" title="创建一个web项目"></a>创建一个web项目</h2><ul>
<li><code>File</code> -> <code>New Project</code> -> 选择<code>Project SDK</code>为1.8 -> <code>Next</code></li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-5274850b1513c8a1.png" alt="新建一个web项目"></p>
<ul>
<li>在<code>Project name</code>中输入项目名称“Demos” ,<code>Project location</code>选择项目要存放的位置,可以默认 -><code>Finish</code></li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-f8ff43a8cbb9cc98.png" alt="输入项目名称"></p>
<h2 id="创建一个Module"><a href="#创建一个Module" class="headerlink" title="创建一个Module"></a>创建一个Module</h2><ul>
<li>鼠标点中项目名称<code>demos</code> -> 右键选择<code>New</code>,选择<code>Module</code> </li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-e88871d34e3c7046.png" alt="新建一个Module"></p>
<ul>
<li>勾选<code>Web Application</code>-> 确认已勾选<code>Create web.xml</code></li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-338f1225f9801b14.png" alt="勾选Web Application"></p>
<ul>
<li>输入Module名称<code>firstweb</code>-> 点击<code>Finish</code></li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-7f12138b09ea8e60.png" alt="输入Module名称"></p>
<h2 id="新建完成的web项目"><a href="#新建完成的web项目" class="headerlink" title="新建完成的web项目"></a>新建完成的web项目</h2><p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-732481307724f8d7.png" alt="新建完web项目后的提示"></p>
<p>新建完成后的目录结构</p>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-be6ee8f55c204e18.png" alt="新建完成后的web项目"></p>
<h2 id="在web-WEB-INF下创建两个文件夹:classes和lib"><a href="#在web-WEB-INF下创建两个文件夹:classes和lib" class="headerlink" title="在web/WEB-INF下创建两个文件夹:classes和lib"></a>在<code>web/WEB-INF</code>下创建两个文件夹:<code>classes</code>和<code>lib</code></h2><blockquote>
<p><code>classes</code>用来存放编译后输出的class文件,<code>lib</code>用于存放第三方jar包。 </p>
</blockquote>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-52802b615412f1a4.png" alt="在web:WEB-INF下创建两个文件夹"></p>
<h2 id="配置文件夹路径"><a href="#配置文件夹路径" class="headerlink" title="配置文件夹路径"></a>配置文件夹路径</h2><ul>
<li><code>File</code> -> <code>Project Structure</code>(快捷键:cmd + ;) -> 选择<code>Module</code> :<br>选择<code>Paths</code> -> 选择<code>Use module compile output path</code> -> 将<code>Output path</code>和<code>Test output path</code>都选择刚刚创建的<code>classes</code>文件夹。</li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-beb36e8aac8e2690.png" alt="选择刚刚创建的classes文件夹"></p>
<ul>
<li>接着选择<code>Dependencies</code> -> 将<code>Module SDK</code>选择为1.8 -> 点击下面的“+”号 -> 选择1 <code>Jars or Directories</code> </li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-ae47a36406b9d2e1.png" alt="选择Jars or Directories"></p>
<ul>
<li>选择刚刚创建的<code>lib</code>文件夹 </li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-fd89e1e15e0aae79.png" alt="选择刚刚创建的lib文件夹"></p>
<ul>
<li>选择<code>jar directory</code> -> 接着返回一路OK就行了~~ </li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-24a1d47cada5534d.png" alt="选择jar directory"></p>
<h2 id="配置Tomcat容器"><a href="#配置Tomcat容器" class="headerlink" title="配置Tomcat容器"></a>配置Tomcat容器</h2><ul>
<li>打开菜单<code>Run</code> -> 选择<code>Edit Configuration</code></li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-9676fbe48eeeafcd.png" alt="配置Tomcat容器"></p>
<ul>
<li>点击“+”号 -> 选择<code>Tomcat Server</code> -> 选择<code>Local</code></li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-d3498baa95a070b6.png" alt="选择Local"></p>
<ul>
<li>点击<code>Application server</code>后面的<code>Configure…</code>,弹出<code>Tomcat Server</code>窗口,选择本地安装的Tomcat目录 -> OK </li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-48d27bf5cbdee9ec.png" alt="弹出Tomcat Server窗口.png"></p>
<ul>
<li>在<code>Run/Debug Configurations</code>窗口的<code>Server</code>选项板中,取消勾选<code>After launch</code>,设置<code>HTTP port</code>和<code>JMX port</code>(默认值即可),点击 <code>Apply</code> -> <code>OK</code>, 至此Tomcat配置完成。 </li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-33f649454b3a1842.png" alt="至此Tomcat配置完成"></p>
<h2 id="在Tomcat中部署并运行项目"><a href="#在Tomcat中部署并运行项目" class="headerlink" title="在Tomcat中部署并运行项目"></a>在Tomcat中部署并运行项目</h2><ul>
<li><code>Run</code> -><code>Edit Configurations</code>,进入<code>Run/Debug Configurations</code>窗口 -> 选择刚刚建立的Tomcat容器 -> 选择<code>Deployment</code> -> 点击下面的“+”号 -> 选择Artifact </li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-9aaac2ed0e1b710b.png" alt="选择Artifact"></p>
<ul>
<li>选择web项目 -><code>Application context</code>可以填<code>/hello</code>(其实也可以不填的~~) -> <code>OK</code> </li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-f56f2719e1b374ab.png" alt="Application context填hello"></p>
<h2 id="编辑index-jsp文件"><a href="#编辑index-jsp文件" class="headerlink" title="编辑index.jsp文件"></a>编辑index.jsp文件</h2><figure class="highlight erb"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div></pre></td><td class="code"><pre><div class="line"><span class="xml"><span class="tag"><<span class="name">%-</span></span></span><span class="ruby">-</span></div><div class="line"> Created by IntelliJ IDEA.</div><div class="line"> <span class="symbol">User:</span> guoyanjun</div><div class="line"> <span class="symbol">Date:</span> <span class="number">2017</span>/<span class="number">5</span>/<span class="number">26</span></div><div class="line"> <span class="symbol">Time:</span> 下午<span class="number">2</span><span class="symbol">:</span><span class="number">59</span></div><div class="line"> To change this template use File <span class="params">| Settings |</span> File Templates.</div><div class="line">-<span class="xml"><span class="tag"><span class="attr">-</span>%></span></span></div><div class="line"><span class="tag"><<span class="name">%</span></span><span class="ruby">@ page contentType=<span class="string">"text/html;charset=UTF-8"</span> language=<span class="string">"java"</span> </span><span class="xml"><span class="tag">%></span></span></div><div class="line"><span class="tag"><<span class="name">html</span>></span></div><div class="line"> <span class="tag"><<span class="name">head</span>></span></div><div class="line"> <span class="tag"><<span class="name">title</span>></span>这是第一个web项目<span class="tag"></<span class="name">title</span>></span></div><div class="line"> <span class="tag"></<span class="name">head</span>></span></div><div class="line"> <span class="tag"><<span class="name">body</span>></span></div><div class="line"> <span class="tag"><<span class="name">p</span>></span>hello world<span class="tag"></<span class="name">p</span>></span></div><div class="line"> <span class="tag"><<span class="name">p</span>></span>第一个项目运行成功啦!<span class="tag"></<span class="name">p</span>></span></div><div class="line"> <span class="tag"></<span class="name">body</span>></span></div><div class="line"><span class="tag"></<span class="name">html</span>></span></div></pre></td></tr></table></figure>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-3e84da088f2f06f6.png" alt="编辑index.jsp文件"></p>
<h2 id="运行Tomcat-在浏览器中查看运行结果"><a href="#运行Tomcat-在浏览器中查看运行结果" class="headerlink" title="运行Tomcat,在浏览器中查看运行结果"></a>运行Tomcat,在浏览器中查看运行结果</h2><p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-ac467778b919d85a.png" alt="运行Tomcat"></p>
<h2 id="Servlet简单实现"><a href="#Servlet简单实现" class="headerlink" title="Servlet简单实现"></a>Servlet简单实现</h2><ul>
<li>编写servlet源文件</li>
<li>在src目录下新建HelloWorld.<a href="http://lib.csdn.net/base/javase" target="_blank" rel="external">Java</a>,并编写一下代码并进行编译:</li>
</ul>
<figure class="highlight scala"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div></pre></td><td class="code"><pre><div class="line"><span class="comment">/**</span></div><div class="line"> * Created by guoyanjun on 2017/5/26.</div><div class="line"> */</div><div class="line"><span class="keyword">import</span> javax.servlet.<span class="type">ServletException</span>;</div><div class="line"><span class="keyword">import</span> javax.servlet.http.<span class="type">HttpServlet</span>;</div><div class="line"><span class="keyword">import</span> javax.servlet.http.<span class="type">HttpServletRequest</span>;</div><div class="line"><span class="keyword">import</span> javax.servlet.http.<span class="type">HttpServletResponse</span>;</div><div class="line"><span class="keyword">import</span> java.io.<span class="type">IOException</span>;</div><div class="line"><span class="keyword">import</span> java.io.<span class="type">PrintWriter</span>;</div><div class="line">public <span class="class"><span class="keyword">class</span> <span class="title">HelloWorld</span> <span class="keyword">extends</span> <span class="title">HttpServlet</span> </span>{</div><div class="line"> <span class="keyword">private</span> <span class="type">String</span> message;</div><div class="line"> <span class="meta">@Override</span></div><div class="line"> public void init()<span class="keyword">throws</span> <span class="type">ServletException</span> {</div><div class="line"> message = <span class="string">"Hello World, This message is from Servlet!"</span>;</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="meta">@Override</span></div><div class="line"> <span class="keyword">protected</span> void doGet(<span class="type">HttpServletRequest</span> req, <span class="type">HttpServletResponse</span> resp) <span class="keyword">throws</span> <span class="type">ServletException</span>, <span class="type">IOException</span> {</div><div class="line"> <span class="comment">//设置响应内容类型</span></div><div class="line"> resp.setContentType(<span class="string">"text/html"</span>);</div><div class="line"> <span class="comment">//设置逻辑实现</span></div><div class="line"> <span class="type">PrintWriter</span> out = resp.getWriter();</div><div class="line"> out.println(<span class="string">"<h3>"</span> + message + <span class="string">"</h3>"</span>);</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="meta">@Override</span></div><div class="line"> public void destroy() {</div><div class="line"> <span class="keyword">super</span>.destroy();</div><div class="line"> }</div><div class="line">}</div></pre></td></tr></table></figure>
<ul>
<li>编译后会发现在classes目录下生成了HelloWorld.class文件 </li>
</ul>
<blockquote>
<p>IDEA创建servlet时找不到<code>import javax.servlet...</code>相关类包的问题</p>
</blockquote>
<p>在IDEA中,创建Servlet时候,当写入如下语句时:<br><figure class="highlight css"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="selector-tag">import</span> <span class="selector-tag">javax</span><span class="selector-class">.servlet</span><span class="selector-class">.ServletException</span>;</div><div class="line"><span class="selector-tag">import</span> <span class="selector-tag">javax</span><span class="selector-class">.servlet</span><span class="selector-class">.http</span><span class="selector-class">.HttpServlet</span>;</div><div class="line"><span class="selector-tag">import</span> <span class="selector-tag">javax</span><span class="selector-class">.servlet</span><span class="selector-class">.http</span><span class="selector-class">.HttpServletRequest</span>;</div><div class="line"><span class="selector-tag">import</span> <span class="selector-tag">javax</span><span class="selector-class">.servlet</span><span class="selector-class">.http</span><span class="selector-class">.HttpServletResponse</span>;</div><div class="line"><span class="selector-tag">import</span> <span class="selector-tag">javax</span><span class="selector-class">.servlet</span><span class="selector-class">.http</span><span class="selector-class">.HttpSession</span>;</div></pre></td></tr></table></figure></p>
<ul>
<li><strong>会提示你,程序包<code>javax.servlet</code>和程序包<code>javax.servlet.http</code>不存在的错误</strong><br>原因在于<a href="http://lib.csdn.net/base/javase" target="_blank" rel="external">Java</a>编译器没有找到软件包<code>javax.servelt</code></li>
<li><strong>解决的方法</strong>:把<code>tomcat</code>安装包里的<code>lib</code>目录下的<code>servlet-api.jar</code>拷贝一份到工程文件夹下的web目录下的<code>WEB-INF</code>目录下<code>lib子</code>文件下的,即 <code>web—>WEB-INF–lib</code></li>
</ul>
<p><a href="http://blog.csdn.net/wodedipang_/article/details/72758708#" target="_blank" rel="external"></a><a href="http://blog.csdn.net/wodedipang_/article/details/72758708#" target="_blank" rel="external"></a><a href="http://blog.csdn.net/wodedipang_/article/details/72758708#" target="_blank" rel="external"></a><a href="http://blog.csdn.net/wodedipang_/article/details/72758708#" target="_blank" rel="external"></a><a href="http://blog.csdn.net/wodedipang_/article/details/72758708#" target="_blank" rel="external"></a><a href="http://blog.csdn.net/wodedipang_/article/details/72758708#" target="_blank" rel="external"></a></p>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-4e5fd3f1cd5dce0f.png" alt="HelloWorld.class文件"></p>
<h2 id="部署servlet"><a href="#部署servlet" class="headerlink" title="部署servlet"></a>部署servlet</h2><blockquote>
<p>方法一:在WEB-INF目录下web.xml文件的标签中添加如下内容:</p>
</blockquote>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></td><td class="code"><pre><div class="line"><span class="php"><span class="meta"><?</span>xml version=<span class="string">"1.0"</span> encoding=<span class="string">"UTF-8"</span><span class="meta">?></span></span></div><div class="line"><span class="tag"><<span class="name">web-app</span> <span class="attr">xmlns</span>=<span class="string">"http://xmlns.jcp.org/xml/ns/javaee"</span></span></div><div class="line"> <span class="attr">xmlns:xsi</span>=<span class="string">"http://www.w3.org/2001/XMLSchema-instance"</span></div><div class="line"> <span class="attr">xsi:schemaLocation</span>=<span class="string">"http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"</span></div><div class="line"> <span class="attr">version</span>=<span class="string">"3.1"</span>></div><div class="line"> <span class="tag"><<span class="name">servlet</span>></span></div><div class="line"> <span class="tag"><<span class="name">servlet-name</span>></span>HelloWorld<span class="tag"></<span class="name">servlet-name</span>></span></div><div class="line"> <span class="tag"><<span class="name">servlet-class</span>></span>HelloWorld<span class="tag"></<span class="name">servlet-class</span>></span></div><div class="line"> <span class="tag"></<span class="name">servlet</span>></span></div><div class="line"> <span class="tag"><<span class="name">servlet-mapping</span>></span></div><div class="line"> <span class="tag"><<span class="name">servlet-name</span>></span>HelloWorld<span class="tag"></<span class="name">servlet-name</span>></span></div><div class="line"> <span class="tag"><<span class="name">url-pattern</span>></span>/HelloWorld<span class="tag"></<span class="name">url-pattern</span>></span></div><div class="line"> <span class="tag"></<span class="name">servlet-mapping</span>></span></div><div class="line"><span class="tag"></<span class="name">web-app</span>></span></div></pre></td></tr></table></figure>
<blockquote>
<p>方法二:在HelloWorld文件的类前面加上:@WebServlet(“/HelloWorld”)</p>
</blockquote>
<ul>
<li>运行servlet</li>
</ul>
<p>点击运行按钮<br><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-19dab062dec1dbcb.png" alt="运行成功"></p>
<ul>
<li>控制台出现successfully则tomcat服务启动成功!<br>打开浏览器输入:<a href="localhost:8080/hello/HelloWorld" target="_blank" rel="external">localhost:8080/hello/HelloWorld</a>即可查看servlet运行状态了。</li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-05-21/258d4bb11899622b989b1dba58c4bbd5/1819713-2f7d1daccfc1e9c8.png" alt="servlet运行状态"></p>
]]></content>
<summary type="html">
<ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li><code>File</code> -&gt; <code>New Project</code> -&gt; 选择<code>Project SDK</code>为1.8 -&gt; <code>Next</code>…
</summary>
<category term="术业专攻" scheme="http://guoyanjun.top/categories/%E6%9C%AF%E4%B8%9A%E4%B8%93%E6%94%BB/"/>
<category term="Server" scheme="http://guoyanjun.top/tags/Server/"/>
</entry>
<entry>
<title>独韵</title>
<link href="http://guoyanjun.top/2017/04/14/the-only-rhyme.html"/>
<id>http://guoyanjun.top/2017/04/14/the-only-rhyme.html</id>
<published>2017-04-14T04:55:00.000Z</published>
<updated>2020-07-07T02:26:03.245Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/blog/assets/css/APlayer.min.css"><script src="/blog/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="/blog/assets/js/Meting.min.js"></script><ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li>菁菁书院,氤氲着杨柳竹韵的婆娑,簇拥着懵懂羞涩的青春韶华,也滋养着奋翅高飞的梦想…<a id="more"></a>
</li>
</ul>
<p></p><p align="center"><br> <a><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-04-14/0f85428c9ebfad7507d4d090ac8de3ad/1819713-b9f009004e4ea3da.jpeg" , width="80%" alt="独韵 / 图片源于网络"></a><br></p><p></p>
<div align="center" style="width: 70%; padding-left: 15%; padding-right: 15%; text-align: left;"><br> <p style="font-family: '楷体'; font-size: 20px;"><br> 菁菁书院,氤氲着杨柳竹韵的婆娑,簇拥着懵懂羞涩的青春韶华,也滋养着奋翅高飞的梦想。</p><p style="font-family: '楷体'; font-size: 20px;"><br> 书院里总荡漾着一种静谧,让人心生陶醉。悠然漫步其间,心亦格外澄净,没有纷纷扰扰,也没有喧喧闹闹。携一卷书,感受厚重的文字的力量,缓缓地踏在这青石板铺就的台阶上,有种飘若浮云的愉悦。深吸一口气,空气中也荡涤着墨香,沁人心脾。古藤萝不声不响地伸展着枝蔓,那缠绕的轨迹是它孜孜不倦的求索。</p><p style="font-family: '楷体'; font-size: 20px;"><br> 一抹晨阳拨开繁叶径直地射在道旁的石阶上,明亮但不刺眼,温润而不恣肆。几缕清风也俏皮地拂动着竹叶的衣袂,似乎要牵子之手,与子同舞。泛着绿光的叶子自然不会倦怠,它们可是舞动的精灵,诚然不会失去飘飞的热情。丝竹幽幽入耳如汉乐唐律,空灵绵长。只刹那间便去那盛世走了一遭。绿叶依然晃着眼,与先前不同的是,它们的嘴角挂着虔诚的微笑。</p><p style="font-family: '楷体'; font-size: 20px"><br> 谁道春风不解风情,只是折柳的一瞬多了些许伤感惜别罢了,或许在遥远的戈壁上也会有千里黄云的同慨。</p><br></div>]]></content>
<summary type="html">
<ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li>菁菁书院,氤氲着杨柳竹韵的婆娑,簇拥着懵懂羞涩的青春韶华,也滋养着奋翅高飞的梦想…
</summary>
<category term="诗文" scheme="http://guoyanjun.top/categories/%E8%AF%97%E6%96%87/"/>
<category term="essay" scheme="http://guoyanjun.top/tags/essay/"/>
</entry>
<entry>
<title>忆清明雨上</title>
<link href="http://guoyanjun.top/2017/04/04/remember-the-qingming-rain.html"/>
<id>http://guoyanjun.top/2017/04/04/remember-the-qingming-rain.html</id>
<published>2017-04-04T00:30:00.000Z</published>
<updated>2020-07-06T10:31:41.091Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/blog/assets/css/APlayer.min.css"><script src="/blog/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="/blog/assets/js/Meting.min.js"></script><ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li>微蒙雨细氲苍穹…<a id="more"></a>
</li>
</ul>
<h2 id="忆清明雨上"><a href="#忆清明雨上" class="headerlink" title="忆清明雨上"></a>忆清明雨上</h2><p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-04-04/1b2b3e47b89a10ca8da13e2a3ceeca4c/1819713-c7ff8e621a97e9af.jpg" alt="忆清明雨上 / 图片源于网络"></p>
<p>微蒙雨细氲苍穹,<br>碧路苔痕印紫藤。<br>醉花迷意寻蝶影,<br>喟叹行人匿歌声。</p>
]]></content>
<summary type="html">
<ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li>微蒙雨细氲苍穹…
</summary>
<category term="诗文" scheme="http://guoyanjun.top/categories/%E8%AF%97%E6%96%87/"/>
<category term="poetry" scheme="http://guoyanjun.top/tags/poetry/"/>
</entry>
<entry>
<title>在github上建立gh-pages分支</title>
<link href="http://guoyanjun.top/2017/03/15/building-gh-pages-branches-on-github.html"/>
<id>http://guoyanjun.top/2017/03/15/building-gh-pages-branches-on-github.html</id>
<published>2017-03-15T04:30:00.000Z</published>
<updated>2017-06-07T07:36:55.000Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/blog/assets/css/APlayer.min.css"><script src="/blog/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="/blog/assets/js/Meting.min.js"></script><ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li><a href="https://github.com/hexojs/hexo" target="_blank" rel="external">hexo</a>是一款基于Node.js的静态博客框架,这篇文章针对Mac用户,熟悉hexo的同学可以绕道哈。初步搭建只需要简单的几步,动动你的手指头,在终端试一下吧…<a id="more"></a>
</li>
</ul>
<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><h3 id="添加gh-pages分支"><a href="#添加gh-pages分支" class="headerlink" title="添加gh-pages分支"></a>添加gh-pages分支</h3><blockquote>
<p>为什么要建立gh-pages分支呢,因为github项目的静态页面解析需要这个名字的分支</p>
</blockquote>
<ul>
<li>进入到你想要上传的文件夹下:</li>
</ul>
<figure class="highlight applescript"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">cd <span class="built_in">text</span></div></pre></td></tr></table></figure>
<ul>
<li>git初始化</li>
</ul>
<figure class="highlight ebnf"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="attribute">git init</span></div></pre></td></tr></table></figure>
<ul>
<li>创建gh-pages分支</li>
</ul>
<figure class="highlight ada"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git checkout <span class="comment">--orphan gh-pages</span></div></pre></td></tr></table></figure>
<ul>
<li>添加文件到暂存区</li>
</ul>
<figure class="highlight dockerfile"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git <span class="keyword">add</span><span class="bash"> .</span></div></pre></td></tr></table></figure>
<ul>
<li>添加信息</li>
</ul>
<figure class="highlight nginx"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="attribute">git</span> commit -m <span class="string">"This is add message"</span></div></pre></td></tr></table></figure>
<blockquote>
<p>或者不写上面的<code>git add .</code>直接写<code>git commit -a -m \"First pages commit\"</code>这个-a参数我查了之后说是对<code>git add .</code>的替代,但我不建议大家使用。</p>
</blockquote>
<ul>
<li>添加仓库</li>
</ul>
<figure class="highlight dockerfile"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git remote <span class="keyword">add</span><span class="bash"> origin [email protected]:username/project.git</span></div></pre></td></tr></table></figure>
<ul>
<li>部署你的项目到github</li>
</ul>
<figure class="highlight maxima"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git <span class="built_in">push</span> <span class="built_in">origin</span> gh-pages</div></pre></td></tr></table></figure>
<h3 id="git删除远程分支"><a href="#git删除远程分支" class="headerlink" title="git删除远程分支"></a>git删除远程分支</h3><p>使用终端,<code>cd到你的工程目录文件夹下</code>,<strong>看清楚可不是当前分支</strong>。git删除仓库实际上可以理解为把一个空的branch赋值给已有的branch,这样就删除了。</p>
<figure class="highlight elixir"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git push origin <span class="symbol">:gh-pages</span></div></pre></td></tr></table></figure>
<h3 id="git命令"><a href="#git命令" class="headerlink" title="git命令"></a>git命令</h3><p>//使用git远程更改github上已存在的仓库文件</p>
<ul>
<li>配置你的账户-用户名<br><code>git config --global user.name yourname</code></li>
<li>配置你的账户-邮箱<br><code>git config --global user.email [email protected]</code></li>
<li>cd到你的目录<br><code>cd /Users/GuoYanjun/Downloads/yourname.github.io</code></li>
<li>git 初始化<br><code>git init</code></li>
<li>由于已经存在仓库,所以需要先在本地同步一下仓库的内容<br><code>git pull [email protected]:yourname/yourrepo.git</code></li>
<li>下面就要把我们本地的上传到仓库上去了,首先执行增加命令,如下:<br>add后面加了一个点,是想要提交所有文件,如果想提交指定的文件,可以写文件名。<br><code>git add .</code></li>
<li>执行完增加命令后,要执行提交命令,如下:<br><code>git commit -m 'Update'</code><br>-m后面跟提示信息,这个提示信息是一定要写的,不仅是规则,同时也方便我们记录我们提交的过程,写清晰为什么提交或修改了什么是非常有用的,提交完成后,我们就要把它推送到远程仓库上去了</li>
<li>执行提交<br><code>git push -u origin master</code></li>
</ul>
]]></content>
<summary type="html">
<ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li><a href="https://github.com/hexojs/hexo">hexo</a>是一款基于Node.js的静态博客框架,这篇文章针对Mac用户,熟悉hexo的同学可以绕道哈。初步搭建只需要简单的几步,动动你的手指头,在终端试一下吧…
</summary>
<category term="术业专攻" scheme="http://guoyanjun.top/categories/%E6%9C%AF%E4%B8%9A%E4%B8%93%E6%94%BB/"/>
<category term="github" scheme="http://guoyanjun.top/tags/github/"/>
</entry>
<entry>
<title>最全iOS开发工具集合</title>
<link href="http://guoyanjun.top/2017/03/07/the-most-comprehensive-colection-of-ios-development-tols.html"/>
<id>http://guoyanjun.top/2017/03/07/the-most-comprehensive-colection-of-ios-development-tols.html</id>
<published>2017-03-07T09:46:00.000Z</published>
<updated>2020-07-06T02:01:25.669Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/blog/assets/css/APlayer.min.css"><script src="/blog/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="/blog/assets/js/Meting.min.js"></script><ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li>目录…<a id="more"></a>
</li>
</ul>
<h2 id="目录"><a href="#目录" class="headerlink" title="目录"></a>目录</h2><ul>
<li><a href="#Xcode">Xcode</a></li>
<li><a href="#Simulators 模拟器下载">Simulators 模拟器下载</a></li>
<li><a href="#Developer Disk Image下载">Developer Disk Image下载</a></li>
<li><a href="#Documentation">Documentation</a></li>
<li><a href="#webStorm">webStorm</a></li>
<li><a href="#Java To iOS">Java To iOS</a></li>
<li><a href="#Markdown编辑器">Markdown编辑器</a></li>
<li><a href="#Xcode插件">Xcode插件</a></li>
<li><a href="#测试">测试</a></li>
<li><a href="#其他测试">其他测试</a></li>
<li><a href="#Beta 测试版本发布">Beta 测试版本发布</a></li>
<li><a href="#部署">部署</a></li>
<li><a href="#App Store">App Store</a></li>
<li><a href="#工具">工具</a></li>
<li><a href="#版本控制工具Git">版本控制工具Git</a></li>
<li><a href="#Photoshop插件">Photoshop插件</a></li>
<li><a href="#矢量图设计工具">矢量图设计工具</a></li>
<li><a href="#切图工具">切图工具</a></li>
<li><a href="#图标处理工具">图标处理工具</a></li>
<li><a href="#在线Icon库">在线Icon库</a></li>
<li><a href="#取色工具">取色工具</a></li>
<li><a href="#Gif图片录制工具">Gif图片录制工具</a></li>
<li><a href="#Design Games">Design Games</a></li>
</ul>
<h2 id="More-Downloads-for-Apple-Developers"><a href="#More-Downloads-for-Apple-Developers" class="headerlink" title="More Downloads for Apple Developers"></a><a name="More Downloads for Apple Developers">More Downloads for Apple Developers</a></h2><p><a href="https://developer.apple.com/download/more/" target="_blank" rel="external">更多下载</a></p>
<h2 id="Xcode"><a href="#Xcode" class="headerlink" title="Xcode"></a><a name="Xcode">Xcode</a></h2><table>
<thead>
<tr>
<th style="text-align:center">版本</th>
<th style="text-align:center">平台</th>
<th style="text-align:center">下载地址</th>
<th style="text-align:center">大小</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">8.2.1</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="http://adcdownload.apple.com/Developer_Tools/Xcode_8.2.1/Xcode_8.2.1.xip" target="_blank" rel="external">官网地址</a></td>
<td style="text-align:center">4.2G</td>
</tr>
<tr>
<td style="text-align:center">8.2</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="http://adcdownload.apple.com/Developer_Tools/Xcode_8.2/Xcode_8.2.xip" target="_blank" rel="external">官网地址</a></td>
<td style="text-align:center">4.2G</td>
</tr>
<tr>
<td style="text-align:center">8.1</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="http://adcdownload.apple.com/Developer_Tools/Xcode_8.1/Xcode_8.1.xip" target="_blank" rel="external">官网地址</a></td>
<td style="text-align:center">4.1G</td>
</tr>
<tr>
<td style="text-align:center">8</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="http://adcdownload.apple.com/Developer_Tools/Xcode_8/Xcode_8.xip" target="_blank" rel="external">官网地址</a></td>
<td style="text-align:center">4.1G</td>
</tr>
<tr>
<td style="text-align:center">7.3</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="https://pan.baidu.com/s/1nvsAw8h" target="_blank" rel="external">百度网盘</a> 密码: npe5</td>
<td style="text-align:center">5.2G</td>
</tr>
<tr>
<td style="text-align:center">7.2</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="https://pan.baidu.com/s/1eSNqLGm" target="_blank" rel="external">百度网盘</a> 密码: g44b</td>
<td style="text-align:center">4.73G</td>
</tr>
<tr>
<td style="text-align:center">7.1</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="https://pan.baidu.com/s/1o7CARIa" target="_blank" rel="external">百度网盘</a> 密码: 8jj8</td>
<td style="text-align:center">4.62G</td>
</tr>
<tr>
<td style="text-align:center">7.1beta</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="http://pan.baidu.com/s/1hsErRDy" target="_blank" rel="external">百度网盘</a> 密码: e9qn</td>
<td style="text-align:center">3.85G</td>
</tr>
<tr>
<td style="text-align:center">6.4</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="http://pan.baidu.com/s/1qYxM5w4" target="_blank" rel="external">百度网盘</a> 密码: iiae</td>
<td style="text-align:center">2.8G</td>
</tr>
<tr>
<td style="text-align:center">6.3</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="http://pan.baidu.com/s/1nv0A2Qt" target="_blank" rel="external">百度网盘</a> 密码: 6mhs</td>
<td style="text-align:center">2.77G</td>
</tr>
<tr>
<td style="text-align:center">6.2</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="http://pan.baidu.com/s/1nu9NG3v" target="_blank" rel="external">百度网盘</a> 密码: xun6</td>
<td style="text-align:center">2.78G</td>
</tr>
</tbody>
</table>
<h2 id="Simulators-模拟器下载"><a href="#Simulators-模拟器下载" class="headerlink" title="Simulators 模拟器下载"></a><a name="Simulators 模拟器下载">Simulators 模拟器下载</a></h2><table>
<thead>
<tr>
<th style="text-align:center">名称</th>
<th style="text-align:center">下载地址</th>
<th style="text-align:center">大小(GB)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">iOS 8.4</td>
<td style="text-align:center"><a href="http://devimages.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK8_4-8.4.1.1435785476.dmg" target="_blank" rel="external">苹果官网地址</a></td>
<td style="text-align:center">1.37</td>
</tr>
<tr>
<td style="text-align:center">iOS 8.3</td>
<td style="text-align:center"><a href="http://devimages.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK8_3-8.3.1.1434581536.dmg" target="_blank" rel="external">苹果官网地址</a></td>
<td style="text-align:center">1.36</td>
</tr>
</tbody>
</table>
<h2 id="Developer-Disk-Image下载"><a href="#Developer-Disk-Image下载" class="headerlink" title="Developer Disk Image下载"></a><a name="Developer Disk Image下载">Developer Disk Image下载</a></h2><table>
<thead>
<tr>
<th style="text-align:center">名称</th>
<th style="text-align:center">下载地址</th>
<th style="text-align:center">大小(MB)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">10.3 (14E5239d).zip</td>
<td style="text-align:center"><a href="https://github.com/chenhuaizhe/src/blob/master/xcode/10.3%20(14E5239d" target="_blank" rel="external">下载地址</a>.zip)</td>
<td style="text-align:center">14.7</td>
</tr>
<tr>
<td style="text-align:center">10.2 (14C89).zip</td>
<td style="text-align:center"><a href="https://github.com/chenhuaizhe/src/blob/master/xcode/10.2%20(14C89" target="_blank" rel="external">下载地址</a>.zip)</td>
<td style="text-align:center">13.8</td>
</tr>
<tr>
<td style="text-align:center">10.0 (14A5339a).zip</td>
<td style="text-align:center"><a href="https://github.com/chenhuaizhe/src/blob/master/xcode/10.0%20(14A5339a" target="_blank" rel="external">下载地址</a>.zip)</td>
<td style="text-align:center">13.8</td>
</tr>
</tbody>
</table>
<p>苹果官网的iOS Developer Library是开发者最喜欢用的知识仓库,但是在Xcode中下载速度实在是太慢!我想用迅雷离线下载怎么办,那就需要知道它的下载地址了。</p>
<h2 id="Documentation"><a href="#Documentation" class="headerlink" title=" Documentation "></a><a name="Documentation"> Documentation </a></h2><table>
<thead>
<tr>
<th style="text-align:center">名称</th>
<th style="text-align:center">下载地址</th>
<th style="text-align:center">大小(MB)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">iOS 9.3</td>
<td style="text-align:center"><a href="https://devimages.apple.com.edgekey.net/docsets/20160321/031-52212-A.dmg" target="_blank" rel="external">下载链接</a></td>
<td style="text-align:center">872.2</td>
</tr>
<tr>
<td style="text-align:center">Xcode 7.3</td>
<td style="text-align:center"><a href="https://devimages.apple.com.edgekey.net/docsets/20160321/031-52213-A.dmg" target="_blank" rel="external">下载链接</a></td>
<td style="text-align:center">264</td>
</tr>
<tr>
<td style="text-align:center">OS X 10.11.4</td>
<td style="text-align:center"><a href="https://devimages.apple.com.edgekey.net/docsets/20160321/031-52211-A.dmg" target="_blank" rel="external">下载链接</a></td>
<td style="text-align:center">932</td>
</tr>
<tr>
<td style="text-align:center">watchOS 2.2</td>
<td style="text-align:center"><a href="https://devimages.apple.com.edgekey.net/docsets/20160321/031-52210-A.dmg" target="_blank" rel="external">下载链接</a></td>
<td style="text-align:center">364.5</td>
</tr>
<tr>
<td style="text-align:center">tvOS 9.2</td>
<td style="text-align:center"><a href="https://devimages.apple.com.edgekey.net/docsets/20160321/031-52214-A.dmg" target="_blank" rel="external">下载链接</a></td>
<td style="text-align:center">307.7</td>
</tr>
</tbody>
</table>
<p>下载后挂载了看到 iOSDocset.pkg, 运行解压之后, 找到com.apple.adc.documentation.iOS.docset,复制到~/Library/Developer/Shared/Documentation/DocSets/ 中,以后更新Xcode不必重复下载此文档</p>
<p><strong>iOS 开发类库总结,猛戳:</strong><a href="http://www.code4app.com/thread-7831-1-1.html" target="_blank" rel="external">网页链接</a></p>
<h2 id="AppCode"><a href="#AppCode" class="headerlink" title="AppCode"></a><a name="AppCode">AppCode</a></h2><table>
<thead>
<tr>
<th style="text-align:center">版本</th>
<th style="text-align:center">平台</th>
<th style="text-align:center">下载地址</th>
<th style="text-align:center">大小</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">April 6,2016</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="https://www.jetbrains.com/objc/download/" target="_blank" rel="external">下载链接</a></td>
<td style="text-align:center">243MB</td>
</tr>
</tbody>
</table>
<h2 id="webStorm"><a href="#webStorm" class="headerlink" title="webStorm"></a><a name="webStorm">webStorm</a></h2><table>
<thead>
<tr>
<th style="text-align:center">版本</th>
<th style="text-align:center">平台</th>
<th style="text-align:center">下载地址</th>
<th style="text-align:center">大小</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">2016.1.1</td>
<td style="text-align:center">Mac</td>
<td style="text-align:center"><a href="http://www.jetbrains.com/webstorm/download/download-thanks.html?platform=mac" target="_blank" rel="external">下载链接</a></td>
<td style="text-align:center">–</td>
</tr>
</tbody>
</table>
<h2 id="Java-To-iOS"><a href="#Java-To-iOS" class="headerlink" title="Java To iOS"></a><a name="Java To iOS">Java To iOS</a></h2><table>
<thead>
<tr>
<th style="text-align:center">名称</th>
<th style="text-align:center">下载地址</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">j2Objc</td>
<td style="text-align:center"><a href="https://github.com/google/j2objc" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">RoboVM</td>
<td style="text-align:center"><a href="http://www.robovm.org/" target="_blank" rel="external">下载链接</a></td>
</tr>
</tbody>
</table>
<h2 id="Markdown编辑器"><a href="#Markdown编辑器" class="headerlink" title="Markdown编辑器"></a><a name="Markdown编辑器">Markdown编辑器</a></h2><p>对于熟悉Markdown的人来说,Mou是一款不错的文本编辑器(Mac平台)。相比同类型产品,Mou 在功能性和易用性上都有众多特色,在其简单的界面之后,不仅拥有自定义样式、增量搜索、中文字体“漂移”优化,还支持终端命令行启动、内容发布、竖版文字布局,甚至还可以作为任务列表使用,其Markdown双栏布局的实时预览和同步滚动功能更是被众多应用借鉴和采用。</p>
<p>可惜的是Mou已不再支持macOS Sierra(10.12.x)已上的系统,所以在这里推荐其他几款支持Markdown语法的软件。</p>
<table>
<thead>
<tr>
<th style="text-align:center">编辑器</th>
<th style="text-align:center">下载地址</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Mou</td>
<td style="text-align:center"><a href="http://25.io/mou/download/Mou.zip" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">MacDown</td>
<td style="text-align:center"><a href="http://macdown.uranusjr.com" target="_blank" rel="external">官网地址</a></td>
</tr>
<tr>
<td style="text-align:center">Typora</td>
<td style="text-align:center"><a href="https://typora.io" target="_blank" rel="external">官网地址</a></td>
</tr>
<tr>
<td style="text-align:center">MaHua</td>
<td style="text-align:center"><a href="http://mahua.jser.me" target="_blank" rel="external">在线编辑器</a></td>
</tr>
</tbody>
</table>
<h2 id="Xcode插件"><a href="#Xcode插件" class="headerlink" title="Xcode插件"></a><a name="Xcode插件">Xcode插件</a></h2><ul>
<li><a href="https://github.com/FuzzyAutocomplete/FuzzyAutocompletePlugin" target="_blank" rel="external">FuzzyAutocompletePlugin</a><br>– 提供了除前缀匹配之外的其他更加灵活的自动补全功能,支持 Xcode 5+。</li>
<li><a href="https://github.com/stefanceriu/SCXcodeMiniMap" target="_blank" rel="external">SCXcodeMiniMap</a><br>– SCXcodeMiniMap 为 Xcode 添加了代码地图功能</li>
<li><a href="https://github.com/larsxschneider/ShowInGitHub" target="_blank" rel="external">Show in Github</a><br>– 可以直接打开 Github 上当前正在编辑的行对应的 commit 页面。</li>
<li><a href="https://github.com/neonichu/BBUFullIssueNavigator" target="_blank" rel="external">BBUFullIssueNavigator</a><br>– 这个插件让 Xcode 在 issue 导航栏显示所有的 issue 内容。</li>
<li><a href="https://github.com/neonichu/BBUDebuggerTuckAway" target="_blank" rel="external">BBUDebuggerTuckAway</a><br>– 当你开始编辑的时候帮你隐藏调试器栏的 Xcode 插件。</li>
<li><a href="https://github.com/stefanceriu/SCXcodeSwitchExpander" target="_blank" rel="external">SCXcodeSwitchExpander</a><br>– SCXcodeSwitchExpander 是一个可以帮你展开 switch 语句的插件,还会自动帮你插入 case 语句。</li>
<li><a href="https://github.com/onevcat/VVDocumenter-Xcode" target="_blank" rel="external">VVDocumenter-Xcode</a><br>– 方便的编写标准注释的 Xcode 插件。</li>
<li><a href="https://github.com/qfish/XAlign" target="_blank" rel="external">XAlign</a><br>– 一个 Xcode 代码自动对齐插件,它可以使用自定义的模式来对齐任何东西。</li>
<li><a href="https://github.com/kattrali/cocoapods-xcode-plugin" target="_blank" rel="external">Cocoapods Xcode Plugin</a><br>– 依赖管理工具 CocoaPods 的 Xcode 插件。</li>
<li><a href="https://github.com/ksuther/KSImageNamed-Xcode" target="_blank" rel="external">KSImageNamed-Xcode</a><br>– 提供了图片名称自动补全功能的插件。</li>
<li><a href="https://github.com/omz/ColorSense-for-Xcode" target="_blank" rel="external">ColorSense-for-Xcode</a><br>– 可视化的颜色选择插件。</li>
<li><a href="https://github.com/limejelly/Backlight-for-XCode" target="_blank" rel="external">Backlight-for-XCode</a><br>– 高亮当前编辑的行。</li>
<li><a href="https://github.com/yeahdongcn/UIColor-Hex-Swift" target="_blank" rel="external">UIColor-Hex-Swift</a><br>– 通过十六进制字符串创建 autorelease 颜色的便利方法。★</li>
<li><a href="https://github.com/kitschpatrol/KPRunEverywhereXcodePlugin" target="_blank" rel="external">KPRunEverywhereXcodePlugin</a><br>– 只需一次点击,就可以在多个 iOS 设备上构建,运行 App。</li>
<li><a href="https://github.com/shjborage/Reveal-Plugin-for-Xcode" target="_blank" rel="external">RevealPlugin</a><br>– 将 Reveal App 和你的项目自动合为一体的 Xcode 插件。</li>
<li><a href="https://realm.io/docs/objc/0.81.0/#xcode-plugin" target="_blank" rel="external">RealmPlugin</a></li>
<li>生成 Realm 模型的 Xcode 插件。</li>
<li><a href="https://github.com/zats/AdjustFontSize-Xcode-Plugin" target="_blank" rel="external">AdjustFontSize</a><br>– 使用 ⌘ + / ⌘ - 快捷键调整字体大小。</li>
<li><a href="https://github.com/questbeat/Lin" target="_blank" rel="external">Lin</a><br>– 这个插件提供了 NSLocalizedString 的自动补全插件。</li>
<li><a href="https://www.rephrase.io/" target="_blank" rel="external">Rephrase</a><br>– Xcode 用于本地化的插件.</li>
<li><a href="https://github.com/pdcgomes/XCActionBar" target="_blank" rel="external">XCActionBar</a><br>– Xcode 的 Alfred。</li>
<li><a href="https://github.com/wiruzx/QuickJump" target="_blank" rel="external">QuickJump</a><br>– Xcode 快速代码导航。</li>
<li><a href="https://github.com/keefo/CATweaker" target="_blank" rel="external">CATweaker</a><br>– 一个用于创建漂亮的 CAMediaTimingFunction 曲线的插件.</li>
<li><a href="https://github.com/onmyway133/XcodeWay" target="_blank" rel="external">XcodeWay</a><br>– 便捷地导航到多个地方。</li>
<li><a href="https://github.com/johnno1962/GitDiff" target="_blank" rel="external">GitDiff</a><br>– 将与 git 仓库中不同的代码高亮。</li>
<li><a href="https://github.com/yuhua-chen/MCLog" target="_blank" rel="external">MCLog</a><br>– 用于控制台内容筛选的插件。</li>
<li><a href="https://github.com/trawor/XToDo" target="_blank" rel="external">XToDo</a><br>– 一个显示项目中 TODO,FIXME,??? 和 !!! 列表的对话框。</li>
<li><a href="https://github.com/hanton/CopyIssue-Xcode-Plugin" target="_blank" rel="external">CopyIssue</a><br>– 使复制 Xcode issuse 描述更简单。</li>
<li><a href="https://github.com/rickytan/RTImageAssets" target="_blank" rel="external">RTImageAssets</a><br>– 自动生成所需的全部 App 图标的插件。</li>
<li><a href="https://github.com/benoitsan/BBUncrustifyPlugin-Xcode" target="_blank" rel="external">BBUncrustifyPlugin-Xcode</a><br>– 使用 ClangFormat 或 Uncrustify 格式化代码的插件。</li>
<li><a href="https://github.com/marksands/Aviator" target="_blank" rel="external">Aviator</a><br>– 这个插件将 AppCode 的 ⇧⌘T (source/test 切换) 带到 Xcode 中.</li>
<li><a href="https://github.com/merrickp/JumpMarks" target="_blank" rel="external">JumpMarks</a><br>– 使用有序的书签为你的代码做导航。</li>
<li><a href="https://github.com/dzenbot/XCSnippetr" target="_blank" rel="external">XCSnippetr</a><br>– 直接上传代码片段到 Slack 和 Gist 的 Xcode 插件。</li>
<li><a href="https://github.com/markohlebar/Peckham" target="_blank" rel="external">Peckham</a><br>– 使用 #import 引用项目中的任何文件,提供代码提示。</li>
<li><a href="https://github.com/molon/MLAutoReplace" target="_blank" rel="external">MLAutoReplace</a><br>– 快速编码以及代码格式化插件,提升你的编码速度。</li>
<li><a href="https://github.com/ViccAlexander/Chameleon" target="_blank" rel="external">Chameleon</a><br>– iOS (Obj-C & Swift)的扁平化颜色框架。★</li>
<li><a href="https://github.com/chiahsien/AutoHighlightSymbol" target="_blank" rel="external">AutoHighlightSymbol</a><br>– 高亮被选中的符号对应的所有实例。</li>
<li><a href="https://github.com/lzwjava/Reveal-In-Github" target="_blank" rel="external">Reveal-In-GitHub</a><br>– 用一个快捷键就可以跳转到 GitHub 仓库的 History, Blame, PRs, Issues, Notifications。</li>
<li><a href="https://github.com/insanoid/CleanHeaders-Xcode" target="_blank" rel="external">CleanHeaders-Xcode</a><br>– 类似 iSort 的头文件排序和重复消除插件,让你的头文件看起来更加有序。</li>
<li><a href="https://github.com/k0nserv/luft" target="_blank" rel="external">Luft</a><br>– 帮助你实现轻量的 View Controller 的 Xcode 插件。</li>
</ul>
<h2 id="测试"><a href="#测试" class="headerlink" title="测试"></a><a name="测试">测试</a></h2><ul>
<li><a href="https://github.com/mokemokechicken/CrashMonkey" target="_blank" rel="external">CrashMonkey</a><br>– iOS 平台的 Monkey 测试工具。</li>
<li><a href="http://appium.io/" target="_blank" rel="external">appium</a><br>– Appium 是一个开源自动化测试框架。用于测试原生或者混合 app。</li>
<li><a href="https://github.com/jollychang/robotframework-appiumlibrary" target="_blank" rel="external">robotframework-appiumlibrary</a><br>– AppiumLibrary 是一个用于 RobotFramwork 的 appium 测试框架。</li>
<li><a href="https://cucumber.io/" target="_blank" rel="external">Cucumber</a><br>– iOS BDD 框架。</li>
<li><a href="https://github.com/kif-framework/KIF" target="_blank" rel="external">Kif</a><br>– 一个 iOS 的函数式测试框架。</li>
<li><a href="https://github.com/inkling/Subliminal" target="_blank" rel="external">Subliminal</a><br>– 一个保守的 iOS 集成测试框架。</li>
<li><a href="https://developer.apple.com/library/ios/documentation/DeveloperTools/Reference/UIAutomationRef/" target="_blank" rel="external">UIAutomation</a><br>– 一个使用脚本在连接着的设备上测试你的用户界面元素的 JavaScript 库。</li>
<li><a href="http://ios-driver.github.io/ios-driver/index.html" target="_blank" rel="external">ios-driver</a><br>– 使用 Selenium / WebDriver 测试任何 iOS 原生,混合或者移动 web 应用。</li>
<li><a href="https://github.com/zucchini-src/zucchini" target="_blank" rel="external">Zucchini</a><br>– 可视化的 iOS 测试框架。</li>
<li><a href="https://github.com/johnno1962/Remote" target="_blank" rel="external">Remote</a><br>– 在 Xcode 内部控制你的 iPhone 来做端到端的测试。</li>
</ul>
<h2 id="其他测试"><a href="#其他测试" class="headerlink" title="其他测试"></a><a name="其他测试">其他测试</a></h2><ul>
<li><a href="https://github.com/Palleas/NaughtyKeyboard" target="_blank" rel="external">NaughtyKeyboard</a><br>– 一个危险字符串的大列表,当用户输入这些字符串使有很大的可能会造成 bug,这是一个用于在你的 iOS 设备上测试你 app 的键盘。</li>
<li><a href="https://github.com/square/PonyDebugger" target="_blank" rel="external">PonyDebugger</a><br>– 使用 Chrome 开发者工具对你的 iOS app 进行远程网络和数据调试。</li>
<li><a href="https://github.com/facebook/ios-snapshot-test-case" target="_blank" rel="external">ios-snapshot-test-case</a><br>– 使用屏幕快照的 iOS 单元测试。</li>
</ul>
<h2 id="Beta-测试版本发布"><a href="#Beta-测试版本发布" class="headerlink" title="Beta 测试版本发布"></a><a name="Beta 测试版本发布">Beta 测试版本发布</a></h2><ul>
<li><a href="https://try.crashlytics.com/" target="_blank" rel="external">Crashlytics</a><br>– 一个崩溃报告和 beta 测试服务。</li>
<li><a href="https://developer.apple.com/testflight/" target="_blank" rel="external">TestFlight Beta Testing</a><br>– iTunes Connect 支持的 beta 测试服务。</li>
<li><a href="http://hockeyapp.net/" target="_blank" rel="external">HockeyApp</a><br>– 在 HockeyApp 你可以发布你 app 的 beta 测试版本,收集实时的崩溃报告,获取用户反馈,分析测试覆盖率。</li>
</ul>
<h2 id="部署"><a href="#部署" class="headerlink" title="部署"></a><a name="部署">部署</a></h2><ul>
<li><a href="https://github.com/fastlane/fastlane" target="_blank" rel="external">fastlane</a><br>将所有 iOS 部署工具整合到一个工作流中。</li>
<li><a href="https://github.com/fastlane/deliver" target="_blank" rel="external">deliver</a><br>部署截屏,app 元数据和 AppStore app 更新,这一切只需要一个命令就可以搞定。</li>
<li><a href="https://github.com/fastlane/snapshot" target="_blank" rel="external">snapshot</a><br>自动地创建全部语言和全部设备的屏幕截图。</li>
</ul>
<h2 id="App-Store"><a href="#App-Store" class="headerlink" title="App Store"></a><a name="App Store">App Store</a></h2><ul>
<li><a href="http://appreviewtimes.com/" target="_blank" rel="external">Average App Store Review Times</a><br>这个网站可以同时跟踪 AppStore 上 iOS 和 Mac 两个版本的浏览次数,使用了利用 iOS 和 Mac 开发者的众包数据。</li>
<li><a href="https://developer.apple.com/app-store/review/rejections/" target="_blank" rel="external">Apple’s Common App Rejections Styleguide</a><br>一些导致 app 被苹果拒绝的重要常见问题。</li>
<li><a href="https://www.mobileaction.co/" target="_blank" rel="external">Free App Store Optimization Tool</a><br>在关键字和竞争者的角度上,让你可视化地追踪你的 App Store 数据。</li>
</ul>
<h2 id="工具"><a href="#工具" class="headerlink" title=" 工具 "></a><a name="工具"> 工具 </a></h2><ul>
<li><a href="https://github.com/kaandedeoglu/Shark" target="_blank" rel="external">Shark</a><br>– 用于将 .xcassets 文件夹转换成一个类型安全枚举的 Swift 脚本。★</li>
<li><a href="https://github.com/mac-cain13/R.swift" target="_blank" rel="external">R.swift</a><br>– 在 Swift 项目中,强类型的自动补全资源名称的工具,包括图片,单元格和 segue 的工具。★</li>
<li><a href="https://github.com/AliSoftware/SwiftGen" target="_blank" rel="external">SwiftGen</a><br>– 一个生成 Swift 代码工具的集合(生成资源的枚举,storyboard,本地化字符串和 UIColor)。★</li>
<li><a href="https://github.com/marmelroy/Localize-Swift" target="_blank" rel="external">Localize-Swift</a><br>– Swift 2.0 实现在应用中切换语言的功能,帮助你的 APP 实现友好的本地化和国际化。★</li>
<li><a href="https://github.com/jondot/blade" target="_blank" rel="external">Blade</a><br>– 为 iOS 和 OS X 应用生成 Xcode 图片目录,全局图片和其他相关的东西。</li>
<li><a href="https://github.com/terwanerik/Retini" target="_blank" rel="external">Retini</a><br>– 一个超级简单的 Retina(2x,3x)图片转换器。</li>
<li><a href="https://github.com/chockenberry/Provisioning" target="_blank" rel="external">Provisioning</a><br>– 一个查看器插件,用于预览 .mobileprovision 文件。</li>
<li><a href="https://github.com/metasmile/strsync" target="_blank" rel="external">Strsync</a><br>– 自动翻译并且使 .strings 文件和默认语言同步。</li>
</ul>
<h2 id="版本控制工具Git"><a href="#版本控制工具Git" class="headerlink" title=" 版本控制工具Git "></a><a name="版本控制工具Git"> 版本控制工具Git </a></h2><table>
<thead>
<tr>
<th style="text-align:center">版本号</th>
<th style="text-align:center">Windows</th>
<th style="text-align:center">Mac OSX</th>
<th style="text-align:center">Linux</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Git-2.0.1</td>
<td style="text-align:center">–</td>
<td style="text-align:center"><a href="http://pan.baidu.com/s/1mgkM9BE" target="_blank" rel="external">下载链接</a></td>
<td style="text-align:center"><a href="https://github.com/inferjay/AndroidDevTools/wiki/Download-for-Linux-and-Unix" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">Git-1.9.4</td>
<td style="text-align:center"><a href="http://pan.baidu.com/s/1ntjy9N7" target="_blank" rel="external">下载链接</a></td>
<td style="text-align:center">–</td>
<td style="text-align:center"><a href="https://github.com/inferjay/AndroidDevTools/wiki/Download-for-Linux-and-Unix" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">Git-1.8.5.2</td>
<td style="text-align:center"><a href="http://pan.baidu.com/s/1ntJWxeD" target="_blank" rel="external">下载链接</a></td>
<td style="text-align:center"><a href="http://pan.baidu.com/s/1bncr1pX" target="_blank" rel="external">下载链接</a></td>
<td style="text-align:center"><a href="https://github.com/inferjay/AndroidDevTools/wiki/Download-for-Linux-and-Unix" target="_blank" rel="external">下载链接</a></td>
</tr>
</tbody>
</table>
<blockquote>
<p>Design Tools 设计工具</p>
</blockquote>
<h2 id="Photoshop插件"><a href="#Photoshop插件" class="headerlink" title=" Photoshop插件 "></a><a name="Photoshop插件"> Photoshop插件 </a></h2><table>
<thead>
<tr>
<th style="text-align:center">名称</th>
<th style="text-align:center">简介</th>
<th style="text-align:center">下载地址</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Cut&Slice</td>
<td style="text-align:center">切图神器</td>
<td style="text-align:center"><a href="http://www.cutandslice.me/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">DevRocket</td>
<td style="text-align:center">切图神器</td>
<td style="text-align:center"><a href="http://www.robovm.org/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">Cutterman</td>
<td style="text-align:center">最好用的切图工具</td>
<td style="text-align:center"><a href="http://www.cutterman.cn/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">Ink</td>
<td style="text-align:center">–</td>
<td style="text-align:center"><a href="http://ink.chrometaphore.com/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">Corner Editor</td>
<td style="text-align:center">路径圆角编辑工具</td>
<td style="text-align:center"><a href="http://photoshopscripts.wordpress.com/" target="_blank" rel="external">下载链接1</a><br><a href="http://sourceforge.net/projects/cornereditor/" target="_blank" rel="external">下载链接2</a></td>
</tr>
<tr>
<td style="text-align:center">GuideGuide</td>
<td style="text-align:center">辅助线工具</td>
<td style="text-align:center"><a href="http://guideguide.me/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">Assistor PS</td>
<td style="text-align:center">–</td>
<td style="text-align:center"><a href="http://assistor.net/en/assistor" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">Skeuomorphism.it</td>
<td style="text-align:center">–</td>
<td style="text-align:center"><a href="http://skeuomorphism.it/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">QuickGuide</td>
<td style="text-align:center">–</td>
<td style="text-align:center"><a href="http://guchitaka.com/project-view/quickguidepro/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">Long Shadow Generator</td>
<td style="text-align:center">长投影效果生成插件</td>
<td style="text-align:center"><a href="http://lab.rayps.com/lsg2/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">android_resizer_toolkit</td>
<td style="text-align:center">–</td>
<td style="text-align:center"><a href="https://github.com/marcosecchi/android_resizer_toolkit" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">android-ps-tools</td>
<td style="text-align:center">一些方便Android UI设计的PhototShop插件</td>
<td style="text-align:center"><a href="http://lab.rayps.com/lc/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">LayerCraft</td>
<td style="text-align:center">用于从图层中导出UI资源的Photoshop插件</td>
<td style="text-align:center"><a href="http://lab.rayps.com/lc/" target="_blank" rel="external">下载链接</a></td>
</tr>
</tbody>
</table>
<h2 id="矢量图设计工具"><a href="#矢量图设计工具" class="headerlink" title=" 矢量图设计工具 "></a><a name="矢量图设计工具"> 矢量图设计工具 </a></h2><table>
<thead>
<tr>
<th style="text-align:center">名称</th>
<th style="text-align:center">下载地址</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Sketch 3</td>
<td style="text-align:center"><a href="http://bohemiancoding.com/sketch/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">Gravit</td>
<td style="text-align:center"><a href="http://gravit.io/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">Adobe Illustrator</td>
<td style="text-align:center"><a href="https://www.adobe.com/cn/products/illustrator.html" target="_blank" rel="external">下载链接</a></td>
</tr>
</tbody>
</table>
<h2 id="切图工具"><a href="#切图工具" class="headerlink" title=" 切图工具 "></a><a name="切图工具"> 切图工具 </a></h2><table>
<thead>
<tr>
<th style="text-align:center">名称</th>
<th style="text-align:center">下载地址</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Slicy</td>
<td style="text-align:center"><a href="http://macrabbit.com/slicy/" target="_blank" rel="external">下载链接</a></td>
</tr>
</tbody>
</table>
<h2 id="图标处理工具"><a href="#图标处理工具" class="headerlink" title=" 图标处理工具 "></a><a name="图标处理工具"> 图标处理工具 </a></h2><table>
<thead>
<tr>
<th style="text-align:center">名称</th>
<th style="text-align:center">下载地址</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Icon Slate</td>
<td style="text-align:center"><a href="http://www.kodlian.com/apps" target="_blank" rel="external">下载链接</a></td>
</tr>
</tbody>
</table>
<h2 id="在线Icon库"><a href="#在线Icon库" class="headerlink" title=" 在线Icon库 "></a><a name="在线Icon库"> 在线Icon库 </a></h2><table>
<thead>
<tr>
<th style="text-align:center">名称</th>
<th style="text-align:center">下载地址</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">IconFont</td>
<td style="text-align:center"><a href="http://iconfont.cn/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">NounProject</td>
<td style="text-align:center"><a href="http://thenounproject.com/" target="_blank" rel="external">下载链接</a></td>
</tr>
</tbody>
</table>
<h2 id="取色工具"><a href="#取色工具" class="headerlink" title=" 取色工具 "></a><a name="取色工具"> 取色工具 </a></h2><table>
<thead>
<tr>
<th style="text-align:center">名称</th>
<th style="text-align:center">下载地址</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">ColorSnapper</td>
<td style="text-align:center"><a href="http://colorsnapper.com/" target="_blank" rel="external">下载链接</a></td>
</tr>
</tbody>
</table>
<h2 id="Gif图片录制工具"><a href="#Gif图片录制工具" class="headerlink" title=" Gif图片录制工具 "></a><a name="Gif图片录制工具"> Gif图片录制工具 </a></h2><table>
<thead>
<tr>
<th style="text-align:center">名称</th>
<th style="text-align:center">下载地址</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">LICEcap</td>
<td style="text-align:center"><a href="http://www.cockos.com/licecap/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">GifCam</td>
<td style="text-align:center"><a href="http://blog.bahraniapps.com/gifcam/" target="_blank" rel="external">下载链接</a></td>
</tr>
<tr>
<td style="text-align:center">Android Tool</td>
<td style="text-align:center"><a href="https://github.com/mortenjust/androidtool-mac/" target="_blank" rel="external">下载链接</a></td>
</tr>
</tbody>
</table>
<h2 id="Design-Games"><a href="#Design-Games" class="headerlink" title=" Design Games "></a><a name="Design Games"> Design Games </a></h2><p><a href="http://bezier.method.ac/" target="_blank" rel="external">The Bezier Game</a>:一个帮助你练习PS里钢笔工具的小游戏。</p>
]]></content>
<summary type="html">
<ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li>目录…
</summary>
<category term="术业专攻" scheme="http://guoyanjun.top/categories/%E6%9C%AF%E4%B8%9A%E4%B8%93%E6%94%BB/"/>
<category term="iOS" scheme="http://guoyanjun.top/tags/iOS/"/>
</entry>
<entry>
<title>Mac 安装 nodejs (图文详细步骤)及SublimeText运行JavaScript控制台</title>
<link href="http://guoyanjun.top/2017/03/06/mac-instals-nodejs-(detailed-steps)-and-sublimetext-runs-the-javascript-console.html"/>
<id>http://guoyanjun.top/2017/03/06/mac-instals-nodejs-(detailed-steps)-and-sublimetext-runs-the-javascript-console.html</id>
<published>2017-03-06T10:00:00.000Z</published>
<updated>2020-07-06T08:17:38.393Z</updated>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/blog/assets/css/APlayer.min.css"><script src="/blog/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="/blog/assets/js/Meting.min.js"></script><ul>
<li><strong>文/一月筠</strong> <strong><code>-- 转载请注明 --</code></strong></li>
<li>由于自己的拓展需求,要临时使用到node.js,所以此次本君就在此mark下 Mac 下node.js的安装和简单的检验示例,给各位小主留个标记,提高下以后的效率。本章对于一些小白而言还是具有普及意义的…<a id="more"></a>
</li>
</ul>
<h2 id="一、Mac-安装-nodejs"><a href="#一、Mac-安装-nodejs" class="headerlink" title="一、Mac 安装 nodejs"></a>一、Mac 安装 nodejs</h2><h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p>由于自己的拓展需求,要临时使用到node.js,所以此次本君就在此mark下 Mac 下node.js的安装和简单的检验示例,给各位小主留个标记,提高下以后的效率。本章对于一些小白而言还是具有普及意义的。</p>
<hr>
<h3 id="step-1:"><a href="#step-1:" class="headerlink" title="step 1:"></a>step 1:</h3><ul>
<li>访问nodejs官网(<a href="https://nodejs.org/en/" target="_blank" rel="external">https://nodejs.org/en/</a>),点击红色选框区域的v6.10.0 LTS版本并下载,详见下图:</li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-03-06/cae38101c2d0aa2f2d00a3da4ab2b60d/1819713-91bf188788b7baf8.png" alt="官网版本.png"></p>
<h3 id="step-2:"><a href="#step-2:" class="headerlink" title="step 2:"></a>step 2:</h3><ul>
<li>双击刚下载的.pkg文件,打开之后按照步骤默认安装就行,安装完成后的截图如下:</li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-03-06/cae38101c2d0aa2f2d00a3da4ab2b60d/1819713-e8435d069c0ae642.png" alt="安装完成.png"></p>
<h3 id="step-3:"><a href="#step-3:" class="headerlink" title="step 3:"></a>step 3:</h3><ul>
<li>安装完成后,需要进一步验证下版本号等信息,在LaunchPad中打开终端,分别输入 :<br><code>npm -v</code><br><code>node -v</code><br>两个命令,如下图出现版本信息,说明安装成功。</li>
</ul>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-03-06/cae38101c2d0aa2f2d00a3da4ab2b60d/1819713-bc21ea7a514f1412.png" alt="终端验证版本号.png"></p>
<h3 id="step-4:"><a href="#step-4:" class="headerlink" title="step 4:"></a>step 4:</h3><ul>
<li>新建一个js文件,nodejsTest.js , 输入下面的代码, 并保存</li>
</ul>
<figure class="highlight vbscript"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line">var http = require(<span class="string">"http"</span>);</div><div class="line"></div><div class="line">http.createServer(<span class="keyword">function</span>(<span class="built_in">request</span>, <span class="built_in">response</span>) {</div><div class="line"> <span class="built_in">response</span>.writeHead(<span class="number">200</span>, {</div><div class="line"> <span class="string">"Content-Type"</span> : <span class="string">"text/plain"</span></div><div class="line"> });</div><div class="line"> <span class="built_in">response</span>.write(<span class="string">"Welcome to Nodejs"</span>);</div><div class="line"> <span class="built_in">response</span>.<span class="keyword">end</span>();</div><div class="line">}).listen(<span class="number">8000</span>, <span class="string">"127.0.0.1"</span>);</div><div class="line"></div><div class="line">console.<span class="built_in">log</span>(<span class="string">"Creat server on http://127.0.0.1:8000/"</span>);</div></pre></td></tr></table></figure>
<p>打开终端进入 nodejsTest.js 所在目录, 输入 node nodejsTest<br>终端显示如下:</p>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-03-06/cae38101c2d0aa2f2d00a3da4ab2b60d/1819713-4482a00a8ea47af7.png" alt="终端运行.png"></p>
<p>打开浏览器,点击或者输入<a href="http://127.0.0.1:8000/" target="_blank" rel="external">http://127.0.0.1:8000/</a>, 如果无法打开,可以将刚才新建的js文件中的.listen(8000, “127.0.0.1”) 的ip监听改成 .listen(8000),然后点击或者输入<a href="http://localhost:8000/" target="_blank" rel="external">http://localhost:8000/</a></p>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-03-06/cae38101c2d0aa2f2d00a3da4ab2b60d/1819713-e6632aff051d597e.png" alt="浏览器测试.png"></p>
<hr>
<h2 id="二、Mac系统下SublimeText运行JavaScript控制台"><a href="#二、Mac系统下SublimeText运行JavaScript控制台" class="headerlink" title="二、Mac系统下SublimeText运行JavaScript控制台"></a>二、Mac系统下SublimeText运行JavaScript控制台</h2><p><strong>Sublime Text 2下载地址:</strong>(<a href="http://www.sublimetext.com/" target="_blank" rel="external">http://www.sublimetext.com/</a>)</p>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-03-06/cae38101c2d0aa2f2d00a3da4ab2b60d/1819713-51d27d09bcfab880.png" alt="Sublime Text 2.png"></p>
<h3 id="前言-1"><a href="#前言-1" class="headerlink" title="前言"></a>前言</h3><p>JavaScript控制台的调试和输出在浏览器端的使用算是工作中常用了,作为前端开发主力编辑器Sublime Text本身是不支持JavaScript的输出和运行的。有的时候我们需要看一下输出的效果,不得不借助于F12查看控制台的程序。作为插件系统及其丰富的编辑器,我们可以通过添加Build System的方法来让<a href="http://www.sublimetext.com/" target="_blank" rel="external">Sublime Text</a>支持Javascript Console控制台调试。</p>
<blockquote>
<p><strong>JSC方式(Mac OS X)</strong></p>
</blockquote>
<h3 id="step-1:-1"><a href="#step-1:-1" class="headerlink" title="step 1:"></a>step 1:</h3><p>Mac内置了一个javascript控制台程序,路径比较深,(可以用命令”open 目录”来打开目录)<br><figure class="highlight awk"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="regexp">/System/</span>Library<span class="regexp">/Frameworks/</span>JavaScriptCore.framework<span class="regexp">/Versions/</span>A<span class="regexp">/Resources/</span>jsc</div></pre></td></tr></table></figure></p>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-03-06/cae38101c2d0aa2f2d00a3da4ab2b60d/1819713-664395cd05acad35.png" alt="打开目录.png"></p>
<h3 id="step-2:-1"><a href="#step-2:-1" class="headerlink" title="step 2:"></a>step 2:</h3><p>启动Sublime Text,Tools > Build System > New Build System,如下图所示:</p>
<p><img src="https://cdn.jsdelivr.net/gh/Yojoon/ImgHosting/images-blog/2017-03-06/cae38101c2d0aa2f2d00a3da4ab2b60d/1819713-3207ab9c2a2e4be7.png" alt="New Build System.png"></p>