Ïê½âÔõÑùÔÚiPadÉÏÓÃvscodeд´úÂë¸ã¿ª·¢
ipadÉÏ¿ÉÒԸ㿪·¢Âð£¿ÏÂÃ汾ƪÎÄÕ¸ø¸÷ÈËÏÈÈÝÒ»ÏÂipadÃë±äÉú²úÁ¦¹¤¾ßµÄÒªÁì–ÔÚipadÉÏÓÃvscodeд´úÂë¸ã¿ª·¢£¬Ï£Íû¶Ô¸÷ÈËÓÐËù×ÊÖú£¡
Ëæ×Åƽ°åµçÄÔµÄÆÕ¼°£¬´ó´ó¶¼È˵ÄÉúÑÄÏ°¹ßºÍÉúÑij¡¾°¶¼Àë²»¿ªÆ½°åµçÄÔµÄʹÓÃ,Ë¢¾ç,¿´¶ÌÊÓƵ,ÍæÖ÷Á÷ÓÎÏ·µÈ,¿ÉÊÇÕâЩֻÊÇÓéÀÖÐÔ×ӵij¡¾°,ÄÇÏëʵÏÖ°Ñƽ°åÍŽᵽÊÂÇé»òÕßÉú²úÖ®Öг¡¾°ÖÐÄØ,Èç±à¼Îĵµ,ÖÆ×÷ÊÂÇé±í¸ñ,±àд´úÂë?
ÒÔÊÇÔÚÈëÊÖipadºó£¬ÎªÁ˱ÜÃâ¡°ÂòËÞÊÀ²úÁ¦£¬Âòºó°®ÆæÒÕ¡±¡£ÎÒÃÇ¿ÉÒÔÔÚlinuxÉϴcode server£¬È»ºóÓÃipadͨ¹ýä¯ÀÀÆ÷»òÕß»òapp£¬À´Ô¶³Ì»á¼ûcode server¡£Ê¹ÓÃЧÀÍÆ÷µÄ×ÊÔ´À´ÅÜ´úÂ룬¶øipadÇ°¶ËÉÏÖ»ÐèÒªÈÏÕæߣ´úÂëºÍÔËÐоͿÉÒÔÀ²£¬ÈÃipadÍêÉƱäÉíÒƶ¯¿ª·¢¹¤¾ß£¡£¡
²¢ÇÒ£¬ÎªÁËʵÏÖÔÚÍâËæʱËæµØÔ¶³ÌÒƶ¯¿ª·¢£¬ÎÒÃÇ´îÅäʹÓÃÁËcpolarÄÚÍø´©Í¸£¬Í»ÆƾÖÓòÍøµÄÏÞÖÆ£¬ÊµÏÖÔÚ¹«ÍøÇéÐÎÏÂÒ²¿ÉÒÔÓÃipadд´úÂ뿪·¢£¡£¡
iPadÃë±äÉú²úÁ¦¹¤¾ß£¡ÔÚiPadÉÏÓÃvscodeд´úÂë¡£¡¾ÍƼöѧϰ£ºvscode½Ì³Ì¡¢±à³Ì½Ìѧ¡¿
1. ÍâµØÇéÐÎÉèÖÃ
×¼±¸Ò»Ì¨ÐéÄâ»ú£¬Ubuntu»òÕßcentos¶¼¿ÉÒÔ£¬ÕâÀïÒÔVMware UbuntuϵͳΪÀý¡£
ÏÂÔØcode serverЧÀÍ
ÔÚä¯ÀÀÆ÷»á¼û£ºhttps://github.com/coder/code-server,¸´ÖÆÏÂÔØÏÂÁî
·¿ªubuntuÏÂÁîÐÐÖ´ÐÐ
curl -fsSL https://code-server.dev/install.sh | sh
µÇ¼ºó¸´ÖÆ
·ºÆðÐèÒªÊäÈëubuntuµÄµÇ¼ÕË»§ÃÜÂë,ÊäÈëÃÜÂë¼´¿É,È»ºóÆÚ´ý×°ÖÃÍê³É
ÒÔÏÂÐÅÏ¢ÌåÏÖ×°ÖÃÀÖ³É
½Ó×ÅÊäÈëÒÔÏÂÏÂÁîÉèÖÃcode-serverµÄµÇ¼ÃÜÂë
export PASSWORD=¡±000000¡±
µÇ¼ºó¸´ÖÆ
Éó²éIPµØµã,×÷¾ÖÓòÍø»á¼ûʹÓÃ
ifconfig
µÇ¼ºó¸´ÖÆ
ÉèÖúÃÃÜÂëºóÆô¶¯code-serverЧÀÍ,ÊäÈëÒÔÏÂÏÂÁî:
code-server --host= ¡°0.0.0.0¡±
µÇ¼ºó¸´ÖÆ
·ºÆðµØµãºÍ¶Ë¿ÚºÅÐÅÏ¢ÌåÏÖÀÖ³É
½Ó×Å·¿ªä¯ÀÀÆ÷ͨ¹ý¾ÖÓòÍø»á¼ûhttp://192.168.30.128:8080/£¬·ºÆðwelcone code-serverÌåÏÖÀÖ³É,ÊäÈëÎÒÃÇÉèÖõÄÃÜÂë,µÇ¼¼´¿É¡£
2. ÄÚÍø´©Í¸
½Ó×ÅÎÒÃÇʹÓÃcpolar´©Í¸ÍâµØcode-serverЧÀÍ,ʹµÃÔ¶³Ì¿ÉÒÔ¾ÙÐлá¼û,ËæʱËæµØд´úÂë¡£cpolarÖ§³Öhttp/https/tcpÐÒ飬²»ÏÞÖÆÁ÷Á¿£¬²Ù×÷¼òÆÓ£¬ÎÞÐ蹫ÍøIP£¬Ò²ÎÞÐè·ÓÉÆ÷¡£
cpolar¹ÙÍø£ºhttps://www.cpolar.com/
2.1 ×°ÖÃcpolarÄÚÍø´©Í¸(Ö§³ÖÒ»¼ü×Ô¶¯×°Öþ籾)
cpolar ×°Ö㨺£ÄÚʹÓã©
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash
µÇ¼ºó¸´ÖÆ
»ò cpolar¶ÌÁ´½Ó×°Ö÷½·¨£º(ÍâÑóʹÓã©
curl -sL https://git.io/cpolar | sudo bash
µÇ¼ºó¸´ÖÆ
Éó²é°æ±¾ºÅ
cpolar version
µÇ¼ºó¸´ÖÆ
tokenÈÏÖ¤
µÇ¼cpolar¹ÙÍøºǫ́£¬µã»÷×ó²àµÄÑéÖ¤£¬Éó²é×Ô¼ºµÄÈÏÖ¤token£¬Ö®ºó½«tokenÌùÔÚÏÂÁîÐÐÀï
cpolar authtoken xxxxxxx
µÇ¼ºó¸´ÖÆ
¼òÆÓ´©Í¸²âÊÔ
cpolar http 8080
µÇ¼ºó¸´ÖÆ
°´ctrl+cÍ˳ö
ÏòϵͳÌí¼ÓЧÀÍ
sudo systemctl enable cpolar
µÇ¼ºó¸´ÖÆ
Æô¶¯cpolarЧÀÍ
sudo systemctl start cpolar
µÇ¼ºó¸´ÖÆ
Éó²éЧÀÍ״̬
sudo systemctl status cpolar
µÇ¼ºó¸´ÖÆ
Õý³£ÏÔʾΪactiveÔòÌåÏÖЧÀÍΪÕý³£ÔÚÏßÆô¶¯×´Ì¬
2.2 ½¨ÉèHTTPËíµÀ
ÔÚubuntuϵͳÍâµØ×°ÖÃcpolarÄÚÍø´©Í¸Ö®ºó£¬ÔÚubuntuä¯ÀÀÆ÷ÉÏ»á¼ûÍâµØ9200¶Ë¿Ú£¬·¿ªcpolar web ui½çÃ棺http://127.0.0.1:9200¡£
µã»÷×ó²àÒDZíÅ̵ÄËíµÀÖÎÀí¡ª¡ª½¨ÉèËíµÀ,ÓÉÓÚcode-serverÖÐÉèÖõÄÊÇ8080¶Ë¿Ú£¬Òò´ËÎÒÃÇÒªÀ´½¨ÉèÒ»ÌõhttpËíµÀ£¬Ö¸Ïò8080¶Ë¿Ú£º
ËíµÀÃû³Æ£º¿É×Ô½ç˵£¬×¢Öز»ÒªÖظ´
ÐÒ飺httpÐÒé
ÍâµØµØµã£º8080
ÓòÃûÀàÐÍ£ºÑ¡ÔñËæ»úÓòÃû
µØÇø£ºÑ¡ÔñChina VIP
µã»÷½¨Éè
½¨ÉèºÃºó,µã»÷×ó²àµÄ״̬¡ª¡ªÔÚÏßËíµÀÁбí,Éó²é¹«ÍøµØµã£¬½«Æ临ÖÆÏÂÀ´
3. ²âÊÔÔ¶³Ì»á¼û
·¿ªipadä¯ÀÀÆ÷,ÊäÈë¸Õ¸Õ¸´ÖƵĹ«ÍøµØµã»á¼û¼´¿É,»á¼ûºóÊäÈëÇ°ÃæÉèÖõÄÃÜÂë,·ºÆðvscode½çÃæÌåÏÖÀÖ³É
4. ÉèÖÃÀο¿¶þ¼¶×ÓÓòÃû
4.1 ±£´æ¶þ¼¶×ÓÓòÃû
ÓÉÓÚÒÔÉÏʹÓÃcpolarËù½¨ÉèµÄËíµÀʹÓõÄÊÇËæ»úÔÝʱ¹«ÍøµØµã£¬¸ÃµØµãÔÚ24СʱÄڻᱬ·¢×ª±ä£¬µ¹ÔËÓÚºã¾ÃÔ¶³Ì»á¼û¡£Òò´ËÎÒÃÇ¿ÉÒÔΪÆäÉèÖöþ¼¶×ÓÓòÃû£¬¸ÃµØµãΪÀο¿µØµã£¬²»»áËæ»úת±ä¡¾ps£ºcpolar.cnÒѱ¸°¸¡¿
ÐèҪעÖØ£¬ÉèÖÃÀο¿¶þ¼¶×ÓÓòÃûÐèÒª½«cpolarÉý¼¶µ½»ù´¡ÌײͻòÒÔÉÏ¡£
µÇ¼cpolar¹ÙÍø£¬µã»÷×ó²àµÄÔ¤Áô£¬Ñ¡Ôñ±£´æ¶þ¼¶×ÓÓòÃû£¬ÉèÖÃÒ»¸ö¶þ¼¶×ÓÓòÃûÃû³Æ£¬µã»÷±£´æ,±£´æÀֳɺó¸´ÖƱ£´æµÄ¶þ¼¶×ÓÓòÃûÃû³Æ
µØÇø£ºÑ¡ÔñChina vip
¶þ¼¶ÓòÃû£º¿É×Ô½ç˵Ìîд
ÐÎò£º¼´±¸×¢£¬¿É×Ô½ç˵Ìîд
4.2 ÉèÖöþ¼¶×ÓÓòÃû
»á¼ûÍâµØ9200¶Ë¿Ú£¬·¿ªcpolar web ui ½çÃ棬µã»÷×ó²àµÄËíµÀÖÎÀí¡ª¡ªËíµÀÁÐ±í£¬ÕÒµ½vscodeËíµÀ£¬µã»÷ÓÒ²àµÄ±à¼
ÐÞ¸ÄÏÂËíµÀÐÅÏ¢£º
ÓòÃûÀàÐ͸ÄΪѡÔñ¶þ¼¶×ÓÓòÃû
subdomain£ºÌîд¸Õ¸Õ±£´æÀֳɵĶþ¼¶×ÓÓòÃû
µã»÷¸üÐÂ
ËíµÀ¸üÐÂÀÖ³ÉÖ®ºó£¬µã»÷×ó²àµÄ״̬¡ª¡ªÔÚÏßËíµÀÁбí,Éó²é¹«ÍøµØµã,´Ëʱ¿ÉÒÔ¿´µ½µØµãÄð³ÉÁ˶þ¼¶ÓòÃû£¬½«Æ临ÖÆÏÂÀ´
5. ²âÊÔʹÓÃÀο¿¶þ¼¶×ÓÓòÃûÔ¶³Ì»á¼û
½Ó×ÅÎÒÃÇÔٴη¿ªipadä¯ÀÀÆ÷£¬»á¼û¸Õ¸ÕÉèÖÃÀֳɵÄÀο¿¶þ¼¶×ÓÓòÃûµØµã,·ºÆðvscode½çÃæÌåÏÖÀÖ³É,¾Í¿ÉÒÔÓä¿ìµÄд´úÂëÀ².
6. iPadͨ¹ýÈí¼þÔ¶³Ìvscode
½ÓÏÂÀ´ÎÒÃÇͨ¹ýservediter for code-serverÈí¼þÀ´ÊµÏÖipadÔ¶³Ì»á¼ûvscode
6.1 ½¨ÉèTCPËíµÀ
Ê×ÏÈÐèÒª½¨ÉèÒ»ÌõTCPËíµÀ£¬Ö¸ÏòÎÒÃÇЧÀÍÆ÷µÄ22¶Ë¿Ú,servediter for code-serverÕâ¸öÈí¼þÐèÒªÅþÁ¬Ð§ÀÍÆ÷,ÔÚubuntuÉÏ·¿ªä¯ÀÀÆ÷»á¼ûÍâµØ9200¶Ë¿Ú£¬µÇ¼cpolar web ui½çÃæ,µã»÷×ó²àµÄËíµÀÖÎÀí¡ª¡ª½¨ÉèËíµÀ
ËíµÀÃû³Æ£º¿É×Ô½ç˵£¬×¢Öز»ÒªÖظ´
ÐÒ飺tcpÐÒé
ÍâµØµØµã£º22
ÓòÃûÀàÐÍ£ºÑ¡ÔñËæ»úÔÝʱTCP¶Ë¿Ú
µØÇø£ºÑ¡ÔñChina VIP
µã»÷½¨Éè
ËíµÀ½¨ÉèÀÖ³ÉÖ®ºó£¬µã»÷×ó²àµÄ״̬¡ª¡ªÔÚÏßËíµÀÁÐ±í£¬½«ËùÌìÉúµÄ¹«ÍøµØµã¸´ÖÆÏÂÀ´¡£
7. ipadÔ¶³Ìvscode
ÔÚipadÉÏ£¬µã»÷·¿ªappstore£¬ÏÂÔØÈí¼þservediter for code-server
ÏÂÔØÀֳɺóµã»÷·¿ª£¬ÓÉÓÚ¸ÃÈí¼þÊǸ¶·ÑµÄ,¿ÉÒÔ×ÔÓÉÑ¡Ôñ¹ºÖÃ,ÕâÀïÑ¡ÔñÃâ·ÑÊÔÓã¬Ñ¡Ôñ×îºóÒ»¸öfree
ÊäÈëÏà¹ØÐÅÏ¢
²ÎÊýÏÈÈÝ:
code-server URL£ºÌîдǰÃæÉèÖÃÀֳɵÄhttp¹«ÍøµØµã¡¾ipadä¯ÀÀÆ÷»á¼ûµÄËÈ˵ص㡿
Instance password£ºcode-serverÉèÖõÄÃÜÂë
Host£ºÕâÀïÌîдÎÒÃÇÇ°Ã潨ÉèÀֳɵÄ22ËíµÀµÄ¹«ÍøµØµã
Username: Õâ¸öÌîдubuntuϵͳµÄÓû§Ãû
Port: ÕâÀïĬÈϼ´¿ÉÎÞÐèÐÞ¸Ä
Authentication: Õâ¸öÌîдubuntuϵͳÓû§Ãû¶ÔÓ¦µÄÃÜÂë
ÊäÈëÍêÐÅÏ¢ºóµã»÷ÓÒÉϽÇsaveºó¾Í»á×Ô¶¯ÅþÁ¬,·ºÆðvscode½çÃæÌåÏÖÅþÁ¬ÀÖ³ÉÀ²
8. ÉèÖÃÀο¿TCP¶Ë¿ÚµØµã
ÓÉÓÚÇ°ÃæÎÒÃǽ¨ÉèµÄssh 22¶Ë¿ÚµÄËíµÀÑ¡ÔñµÄÊÇËæ»úÔÝʱµØµã,¸ÃµØµã»áÔÚ24СʱÄÚת±ä,ΪÁËʹÎÒÃÇipadÄÚÀïʹÓÃvscodeÅþÁ¬Ô½·¢Í¨³©,ÎÒÃÇÐèÒªÀο¿ssh µÄ¹«ÍøµØµã¡£
×¢ÖØÐèÒª½«cpolarÌײÍÉý¼¶ÖÁרҵÌײͻòÒÔÉÏ¡£
8.1 ±£´æÀο¿TCPµØµã
µÇ¼cpolar¹ÙÍøºǫ́£¬µã»÷×ó²àµÄÔ¤Áô£¬ÕÒµ½±£´æµÄTCPµØµã£º
µØÇø£ºÑ¡ÔñChina VIP
ÐÎò£º¼´±¸×¢£¬¿É×Ô½ç˵Ìîд
µã»÷±£´æ
Àο¿TCPµØµã±£´æÀֳɣ¬ÏµÍ³ÌìÉúÏìÓ¦µÄ¹«ÍøµØµã+Àο¿¶Ë¿ÚºÅ£¬½«Æ临ÖÆÏÂÀ´
8.2 ÉèÖÃÀο¿TCP¶Ë¿ÚµØµã
ä¯ÀÀÆ÷»á¼ûhttp://127.0.0.1:9200/µÇ¼cpolar web UIÖÎÀí½çÃ棬µã»÷×ó²àÒDZíÅ̵ÄËíµÀÖÎÀí¡ª¡ªËíµÀÁÐ±í£¬ÕÒµ½codeserverËíµÀ£¬µã»÷ÓÒ²àµÄ±à¼
ÐÞ¸ÄËíµÀÐÅÏ¢£¬ÉèÖÃÀο¿TCP¶Ë¿ÚµØµã£º
¶Ë¿ÚÀàÐÍ£º¸ÄΪѡÔñÀο¿TCP¶Ë¿Ú
Ô¤ÁôµÄTCPµØµã£ºÌîд¸Õ¸Õ±£´æÀֳɵÄÀο¿TCP¶Ë¿ÚµØµã
µã»÷¸üÐÂ
ÌáÐѸüÐÂËíµÀÀֳɣ¬µã»÷×ó²àÒDZíÅ̵Ä״̬¡ª¡ªÔÚÏßËíµÀÁÐ±í£¬¿ÉÒÔ¿´µ½¸Õ¸ÕÐ޸ĵÄËíµÀµÄ¹«ÍøµØµãÒѾ¸üÐÂΪÀο¿TCP¶Ë¿ÚµØµã£¬½«Æ临ÖÆÏÂÀ´¡£
9. ʹÓÃÀο¿TCPµØµãÔ¶³Ìvscode
ÔÚipadÉÏ£¬·¿ªservediter for code-serverÈí¼þ£¬ÐÞ¸ÄhostµÄ²ÎÊý£¬½«ÆäÐÞ¸ÄΪÎÒÃǸոÕÉèÖÃÀֳɵÄÀο¿TCP¶Ë¿ÚµØµã¡£
µã»÷×óÉϽÇi±ê¼Ç
Ñ¡Ôñself Host Server
°ÑHostÖµ¸ÄΪÎÒÃǸոչÙÍø±£´æµÄtcpµØµã
¸ü¸ÄÍêºóµã»÷ÓÒÉϽÇsave,µã»÷Íêºó»á×Ô¶¯ÅþÁ¬,·ºÆðvscde½çÃæÌåÏÖÀÖ³ÉÁË,ÖÁ´Ë,½Ì³Ì¾Í¿¢ÊÂÁË,ʹÓÃipad¿ªÆôÓä¿ìµÄ±à³Ì°É£¡¸Ã¹«ÍøµØµã²»»áÔÙËæ»úת±äÁË¡£
¸ü¶à¹ØÓÚVSCodeµÄÏà¹Ø֪ʶ£¬Çë»á¼û£ºvscode»ù´¡½Ì³Ì£¡
ÒÔÉϾÍÊÇÏê½âÔõÑùÔÚiPadÉÏÓÃvscodeд´úÂë¸ã¿ª·¢µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡