For Ubuntu
安装VSCode
安装基本工具
$ sudo apt install python3.8-venv
$ sudo apt install curl
安装devicetool
# 执行安装设备开发工具
$ sudo sh devicetool-linux-tool-3.0.0.300.sh
For Fedora
准备软件
https://device.harmonyos.com/cn/develop/ide/
官方默认提供的是 ubuntu 的安装包,主要是取决于 apt-get命令(下面会有一篇文章,专门介绍这一环节)
使用inotifywait监控文件变化
安装vscode
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
dnf check-update
sudo dnf install code
安装python3.8 并切换版本
操作系统默认是3.10 目前版本只支持3.8 3.9
sudo dnf install python3.8
# 切换版本
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
sudo dnf install python3-pip
安装 authbind
rpm -Uvh https://s3.amazonaws.com/aaronsilber/public/authbind-2.1.1-0.1.x86_64.rpm
mtd-utils
sudo dnf install mtd-utils
hpm
安装apt
主要是用于跳过安装失败的命令,没有实际意义
$ sudo dnf install apt
For OpenSUSE
安装 vscode
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/zypp/repos.d/vscode.repo'
sudo zypper refresh
sudo zypper install code
python
目前仓库里面只有 python39 这个方法后面报错看不明白失败了(猜测是缺少依赖)
sudo zypper install python39
# 切换版本
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1
使用python 3.8 源码编译 这个稍候单独发一篇文章
authbind
sudo rpm -Uvh https://s3.amazonaws.com/aaronsilber/public/authbind-2.1.1-0.1.x86_64.rpm
mtd-utils
sudo zypper install mtd-utils
hpm
apt-get
sudo zypper install zypper-aptitude
安装过程
安装命令
$ chmod +x devicetool-linux-tool-3.0.0.300.sh
$ sudo ./devicetool-linux-tool-3.0.0.300.sh
安装日志
Verifying archive integrity... 100% All good.
Uncompressing DevEco Device Tool 3.0.0+300.7e5dafe4 100%
running installation by harmonyos
python: /usr/bin/python /usr/share/man/man1/python.1.gz
Python '/usr/bin/python' will be used
[INFO ] Installed product can not be found
[INFO ] Creating uninstall script...
[INFO ] Installing core...
[INFO ] Installing core site-packages...
[INFO ] Checking virtual environment...
[INFO ] Installing core files...
[INFO ] Installing tools...
[INFO ] Installing platforms...
[INFO ] Installing extensions...
[WARNING] Plugin plugin-vscode is not installed. Install it manually from file "/home/harmonyos/Huawei/DevEco-Device-Tool/plugins/deveco-device-tool-3.0.0+300.7e5dafe4.vsix"
[WARNING] or use command line: "code --install-extension /home/harmonyos/Huawei/DevEco-Device-Tool/plugins/deveco-device-tool-3.0.0+300.7e5dafe4.vsix"
[WARNING] Plugin plugin-vscode-remote is not installed. Install it manually from file "/home/harmonyos/Huawei/DevEco-Device-Tool/plugins/deveco-device-tool-remote-3.0.0+300.7e5dafe4.vsix"
[WARNING] or use command line: "code --install-extension /home/harmonyos/Huawei/DevEco-Device-Tool/plugins/deveco-device-tool-remote-3.0.0+300.7e5dafe4.vsix"
[INFO ] Creating launch script...
[INFO ] Creating setenv.sh script...
[INFO ] Updating settings...
[INFO ] Updating permissions...
[INFO ] Creating authbind config...
[INFO ] Updating u-dev rules...
[INFO ] Installing mtd-utils...
[ERROR ] Command "apt install mtd-utils" failed with code 100. Install it manually!
Deveco Device Tool successfully installed.
安装 vscode 插件
$ code --install-extension /home/harmonyos/Huawei/DevEco-Device-Tool/plugins/deveco-device-tool-3.0.0+300.7e5dafe4.vsix
$ code --install-extension /home/harmonyos/Huawei/DevEco-Device-Tool/plugins/deveco-device-tool-remote-3.0.0+300.7e5dafe4.vsix