Dart+GRPC Ubuntu環境安裝和測試
阿新 • • 發佈:2020-12-12
GRPC Dart Ubuntu
-
下載dart sdk 2.10壓縮包(國內訪問不到)
官方地址:https://storage.googleapis.com/dart-archive/channels/stable/release/2.10.4/sdk/dartsdk-linux-x64-release.zip 我的地址:https://download.csdn.net/download/HumorChen99/13646501
-
解壓、新增到環境裡去
unzip dartsdk-linux-x64-release.zip cd dart-sdk\bin pwd
-
更換pub源為清華源
echo 'export PUB_HOSTED_URL="https://mirrors.tuna.tsinghua.edu.cn/dart-pub"' >> ~/.bashrc source ~/.bashrc
-
安裝apt-transport-https
apt update apt-get
-
安裝proto編譯器protoc
apt install protobuf-compiler -y #檢視 protoc --version
-
安裝dart外掛protoc_plugin
pub global activate protoc_plugin echo 'export PATH=$PATH:/root/.pub-cache/bin' >> /etc/profile source /etc/profile
-
下載示範專案並執行
git clone https://github.com/grpc/grpc-dart cd grpc-dart/example/helloworld #獲取依賴包