一、官网下载VMware Workstation Pro16,下载地址,安装教程
二、下载ubuntu2004镜像,下载地址
三、webrtc编译
-
安装depot_tools
-
步骤如下
wget https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip unzip commandlinetools-linux-6609375_latest.zip -d cmdline-tools mkdir --parents "$ANDROID_HOME/cmdline-tools/latest" sudo mv cmdline-tools/* "$ANDROID_HOME/cmdline-tools/latest/" export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$PATH
-
执行gclient
gclient
-
-
获取源码
mkdir webrtc_android cd webrtc_android fetch --nohooks webrtc_android
同步完成以后,自动生成文件,修改根目录下.gclient文件
solutions = [ { "name": "src", "url": "git@gitlab.xxx.webrtc.git", "deps_file": "DEPS", "managed": False, "custom_deps": {}, }, ] target_os = ["android", "unix"]
-
gclient同步
进入src目录gclient sync
-
使用GN生成项目
cd src gn gen out/release --args='target_os="android" target_cpu="arm"'
-
依赖安装
./build/install-build-deps.sh ./build/install-build-deps-android.sh
-
编译脚本
./tools_webrtc/android/build_aar.py --build-dir out --arch "armeabi-v7a" "arm64-v8a"gn gen out/xrouter_sdk_arm64-v8a --args='is_debug=false use_rtti=true target_os="android" target_cpu="arm64" rtc_build_tools=false rtc_enable_protobuf=false rtc_include_tests=false treat_warnings_as_errors=false proprietary_codecs=true' cp ./build_script/android_only_jni_exports.lst ./build/android/ ninja -C out/xrouter_sdk_arm64-v8a xrouter:xrtc_router -t clean ninja -C out/xrouter_sdk_arm64-v8a xrouter:xrtc_router
- 各种报错处理