栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Docker 部署 IntelliJ Projector,愉快玩耍 Android Studio、Idea、PyCharm 等 Swing 应用

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Docker 部署 IntelliJ Projector,愉快玩耍 Android Studio、Idea、PyCharm 等 Swing 应用

前言

Projector 是 IntelliJ 推出的使用远程 IDE 进行开发的解决方案。它使开发者可以在远程使用 Idea、PyCharm、GoLand、CLion、Android Studio 等基于 Java Swing 技术构建的 IDE。

同类产品有也是 IntelliJ 家出品的 Gateway。

说明:这只是一个可选项,是对开发体验的补充。有选择的话,谁不想手上的工作笔记本轻薄、性能强大、续航持久。

应用场景
  • 处理公司紧急问题,带不想待沉重的笔记本回家,并且公司正好提供云服务器/开发机。
  • 家里有高性能台式机,部署后,可以使用轻薄本随时随地(在家里 or 外面)开发。
优点
  • 释放笔记本性能,编译大型工程不会导致风扇呼呼转。
  • 体验服务器的强大性能。
  • 随时随地访问,摆脱带公司笔记本回家的烦恼。
缺点
  • 体验高度依赖网络质量。

结合优缺点,如果真希望日常使用,建议在局域网内部署、访问。

步骤
  1. 配置 Docker 环境
  2. 安装 Projector
  3. 安装 IDE:Android Studio、PyCharm
1. 配置 Docker 环境 1.1 创建 Docker 容器

使用 debian 最新镜像,创建一个后台容器,并暴露容器的 8880、22 等端口。

docker run -it -d -p 8880:8880 -p 2222:22 debian:latest

随后进入容器

docker exec -it  /bin/bash
1.2 更换软件源
# 使用中科大 debian 软件源
sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
# 使用中科大 debian security 软件源
sed -i 's|security.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list
1.3 更新容器内的 debian 系统
apt update
apt upgrade -y
2. 安装 Projector

以下操作均在容器内部。

2.1 安装/更新必备依赖
apt install python3 python3-pip python3-cryptography python3-netifaces -y
apt install less libxext6 libxrender1 libxtst6 libfreetype6 libxi6 -y
apt install curl git -y
python3 -m pip install -U pip
2.2 安装 Projector
pip3 install projector-installer
3. 使用 Projector

Projector 内置支持的应用可以通过 projector install 命令查看、安装。

3.1 安装并使用 Idea 3.1.1 安装 Idea
projector install Idea_Ultimate

3.1.2 修改配置:
projector config edit IntelliJ

主要是修改端口和监听的 IP 地址。

3.1.3 运行 Idea
projector run IntelliJ
3.1.4 使用 Idea

打开浏览器,输入:http://localhost:8880

3.2 安装并使用 Android Studio

由于 License 原因,AS 并未在 Projector 中内置支持,但显然也是可以用的(AS 本身基于 Idea 进行定制开发)。

3.2.1 下载 Linux 版 AS

注意:对 AS 版本有要求,建议使用最新版。

cd ~/.projector/apps/
curl -OL https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2021.2.1.15/android-studio-2021.2.1.15-linux.tar.gz
tar zxvf android-studio-2021.2.1.15-linux.tar.gz

解压后的文件夹名为:android-studio。

3.2.2 添加 AS 到 Projector
projector config add

3.2.3 配置 Projector
projector config edit android_studio


主要是配置端口和监听地址(为了后面外网能访问)。

3.2.4 使用 AS
projector run android_studio


诶,这界面看上去不是浏览器打开的,不会是匡我吧?并没有(注意左上角菜单栏),这里是使用了 Projector-Client native app,它是基于 Electron 构建的,建议真实使用中,少用 Web,避免快捷键冲突问题!

后续 QA 1. Web 版,剪切板无法正常使用?

需要配置 SSL 证书。参考:https://github.com/JetBrains/projector-installer#secure-connection

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/941607.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号