IPad + vscode 实现远程开发

发布时间 2023-08-29 10:07:21作者: coreylin

IPad + vscode 实现远程开发

Target

  • 想通过使用 ipad 作为一个生产力工具的补充,在家用mac mini,出门用ipad(别问为啥不直接MAC BOOK,我自己也不理解),总之,我打算用IPad 作为一个轻量的移动办公。
  • 采用的解决方案: 在个人服务器上,搭建 vscode server 端,然后用Ipad 浏览器访问

Content

Step1 安装服务

https://github.com/coder/code-server/releases 中找到最新的发布版本,下载

wget https://github.com/coder/code-server/releases/download/v4.16.1/code-server-4.16.1-linux-amd64.tar.gz
tar -xvzf code-server-4.16.1-linux-amd64.tar.gz
cd code-server-4.16.1-linux-amd64

Step2 运行服务

export PASSWORD="xxxxx"
./bin/code-server --port 9085 --auth password

Step3 IPad 使用ESC

IPad 的妙控键盘中,没有 ESC 按键,在实际使用中会比较不方便(例如vim退出),可以通过将 ?  按钮设置为 ESC,

  • 具体位置:设置 — 通用 — 实体键盘 — 修饰键
  • 将地球仪键对应的功能,设置为 Escape

Step4 保存为桌面应用

通过 safari 访问 vscode 页面,然后将页面导出到桌面,即可实现像”应用“一样在 ipad 上使用 vscode。

TroubleShooting

Q1: 打开文件目录报错 : File system provider for vscode-remote://139.xxx.xxx.xx/ is not available.

后台报错: File not found: /data/release/code_server/lib/vscode/extensions/git-base/dist/browser/extension.js

解决方案:

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    listen 80;
    server_name jupyter.sample.domain;

    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;

    location / {
        proxy_pass   http://jupyterlab:8888;
    }
}

来源:https://github.com/microsoft/vscode-remote-release/issues/7163