一、安裝depot_tools工具

首先你的電腦上安裝了git

1)    下載depot_tools

cd到下載的目錄下

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

 

使用git下載源碼的時候會報這樣的錯誤

unable to access 'https://chromium.googlesource.com/chromium/tools/depot_tools.git/': Failed to connect to chromium.googlesource.com port 443: Operation timed out

可以按照下面這篇博客的方式進行配置就能下載了

https://laod.cn/hosts/2017-google-hosts.html/comment-page-6

2)    把depot_tools的路徑添加到export PATH=`pwd`/depot_tools:"$PATH"

3)    檢測路徑是否添加正確

運行命令echo $PATH,查看工具的路徑是否正確,如果不正確的話

下載webrtc的源碼會報錯fetch: command not found

檢測depot_tools是否配置正確的方式還可以直接在終端輸入gn然后按tab鍵

如果配置正確將顯示

gn         gn.py      gnuattach  gnuclient  gnudoit    gnumake    gnuserv

如果配置不正確將顯示

gnuattach  gnuclient  gnudoit    gnumake    gnuserv

 

 

二、下載webrtc的源碼

首先你需要有VPN能FQ,推薦使用紅杏

fetch --nohooks webrtc_ios
gclient sync

網(wǎng)友評論