For Ubuntu

安装VSCode

安装基本工具

  1. $ sudo apt install python3.8-venv
  2. $ sudo apt install curl

安装devicetool

  1. # 执行安装设备开发工具
  2. $ sudo sh devicetool-linux-tool-3.0.0.300.sh

For Fedora

准备软件

https://device.harmonyos.com/cn/develop/ide/

官方默认提供的是 ubuntu 的安装包,主要是取决于 apt-get命令(下面会有一篇文章,专门介绍这一环节)
使用inotifywait监控文件变化

安装vscode

  1. sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
  2. 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'
  3. dnf check-update
  4. sudo dnf install code

安装python3.8 并切换版本

操作系统默认是3.10 目前版本只支持3.8 3.9

  1. sudo dnf install python3.8
  2. # 切换版本
  3. sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
  4. sudo dnf install python3-pip

安装 authbind

  1. rpm -Uvh https://s3.amazonaws.com/aaronsilber/public/authbind-2.1.1-0.1.x86_64.rpm

mtd-utils

  1. sudo dnf install mtd-utils

hpm

Ubuntu 安装hpm命令最佳实践

安装apt

主要是用于跳过安装失败的命令,没有实际意义

  1. $ sudo dnf install apt

For OpenSUSE

安装 vscode

  1. sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
  2. 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'
  3. sudo zypper refresh
  4. sudo zypper install code

python

目前仓库里面只有 python39 这个方法后面报错看不明白失败了(猜测是缺少依赖)

  1. sudo zypper install python39
  2. # 切换版本
  3. sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1

使用python 3.8 源码编译 这个稍候单独发一篇文章

authbind

  1. sudo rpm -Uvh https://s3.amazonaws.com/aaronsilber/public/authbind-2.1.1-0.1.x86_64.rpm

mtd-utils

  1. sudo zypper install mtd-utils

hpm

Ubuntu 安装hpm命令最佳实践

apt-get

  1. sudo zypper install zypper-aptitude

安装过程

安装命令

  1. $ chmod +x devicetool-linux-tool-3.0.0.300.sh
  2. $ sudo ./devicetool-linux-tool-3.0.0.300.sh

安装日志

  1. Verifying archive integrity... 100% All good.
  2. Uncompressing DevEco Device Tool 3.0.0+300.7e5dafe4 100%
  3. running installation by harmonyos
  4. python: /usr/bin/python /usr/share/man/man1/python.1.gz
  5. Python '/usr/bin/python' will be used
  6. [INFO ] Installed product can not be found
  7. [INFO ] Creating uninstall script...
  8. [INFO ] Installing core...
  9. [INFO ] Installing core site-packages...
  10. [INFO ] Checking virtual environment...
  11. [INFO ] Installing core files...
  12. [INFO ] Installing tools...
  13. [INFO ] Installing platforms...
  14. [INFO ] Installing extensions...
  15. [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"
  16. [WARNING] or use command line: "code --install-extension /home/harmonyos/Huawei/DevEco-Device-Tool/plugins/deveco-device-tool-3.0.0+300.7e5dafe4.vsix"
  17. [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"
  18. [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"
  19. [INFO ] Creating launch script...
  20. [INFO ] Creating setenv.sh script...
  21. [INFO ] Updating settings...
  22. [INFO ] Updating permissions...
  23. [INFO ] Creating authbind config...
  24. [INFO ] Updating u-dev rules...
  25. [INFO ] Installing mtd-utils...
  26. [ERROR ] Command "apt install mtd-utils" failed with code 100. Install it manually!
  27. Deveco Device Tool successfully installed.

安装 vscode 插件

  1. $ code --install-extension /home/harmonyos/Huawei/DevEco-Device-Tool/plugins/deveco-device-tool-3.0.0+300.7e5dafe4.vsix
  2. $ code --install-extension /home/harmonyos/Huawei/DevEco-Device-Tool/plugins/deveco-device-tool-remote-3.0.0+300.7e5dafe4.vsix