Compilation of webrtc android version and acquisition of release version

This article mainly introduces how to compile the android version of webrtc under the ubuntu16.0.4 platform. For those who are just starting to use webrtc, this blog may help you! For me who is forgetful, it can be regarded as a kind of study notes. When necessary, it is also excellent to go back and look at it. Ok, let's get to the point:

Note: Please make sure you have overcome the wall before compiling.

  1. Download a series of tools provided by google, namely the toolkit (required)
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  1. Configure the PATH environment variable, which can be used directly by using google tools
export PATH=$PATH:/path/to/depot_tools

This command is only valid for the current terminal. If you want to take effect globally, you can write this statement into .bashrc, and then execute source ~/.bashrc to make it take effect.

  1. Get webrtc source code
fetch --nohooks webrtc_android
  1. Sync code (update code)
gclient sync

Some warning messages may appear during the process: "To use a proxy in this situation, please supply those settings in a .boto file pointed to by the NO_AUTH_BOTO_CONFIG environment var." At this time, you need to configure the .boto file, and there are related solutions on the Internet plan, I will not be a porter.
Finally, there will be a confirmation of a lience, just enter Y.

  1. If you need to download the release version of webrtc, refer to the official website

5.1 Check the available release version: git branch -r
5.2 Get the specified version of webrtc source code: git checkout -b my_branch refs/remotes/branch-heads/43. Note: There is some correspondence between different source codes and the version of the depot_tools toolkit, so if an error occurs during the update process, it is best to update depot_tools to a version near the release of the webrtc source code.
5.3 How to get the release-branch specifically, see 5.3.1 here
:

#以下的官网的原话,英文不好,就不做翻译了
#Make sure you are in 'src'.
#This part should only need to be done once, but it won't hurt to repeat it. The first
#time checking out branches and tags might take a while because it fetches an extra
#1/2 GB or so of branch commits.
 
gclient sync --with_branch_heads --with_tags

5.3.2

#You may have to explicitly 'git fetch origin' to pull branch-heads/
git fetch

5.3.3

# Checkout the branch 'src' tree.
git checkout -b branch_$BRANCH branch-heads/$BRANCH

5.3.4

# Checkout all the submodules at their branch DEPS revisions.
#该步骤会同步代码,需要一点时间,等到完成后即可以,其它的编译步骤与官网所给出的步骤一致。
gclient sync --with_branch_heads --with_tags

5.3.5

gclient sync
#此时可能会报错,如下:
#src/third_party at a3a6c8af12026c268349ddecd0dc5643a6ea6cae
#You have unstaged changes.
#Please commit, stash, or reset.
#说第三方库有改动,但git diff及git status并没有发现哪里有改动啊?怎么办?最笨的办法就是#备份一下third_pardy然后删除它,重新执行gclient sync,如果大家有更好的处理办法,一起分#享出来。
  1. Compile with gn

6.1 Detailed use
of gn gn gen out/armeabi-v7a --args='target_os="android" target_cpu="arm" is_debug=false use_rtti=true'

6.2:ninja -C out/armeabi-v7a

6.3:
Package aar command: tools_webrtc/android/build_aar.py

Guess you like

Origin blog.csdn.net/TopsLuo/article/details/86543900