一、参考github 介绍:https://github.com/openstf/minicap
Requirements (前提)
- NDK, Revision 10e (May 2015)
- make (http://gnuwin32.sourceforge.net/packages/make.htm ,Setup program 会自带依赖库文件)
- android studio 下安装。
Building(编译)
We include libjpeg-turbo as a Git submodule, so first make sure you've fetched it.(在minicap目录下执行git命令,如果没有git可以下载。)
git submodule init
git submodule update
You're now ready to proceed.
Building requires NDK, and is known to work with at least with NDK Revision 10e (May 2015). Older versions do not work due to the lack of .asm
file support for x86_64.
Then it's simply a matter of invoking ndk-build
. (最简单的方式..\Android\sdk\ndk-bundle目录下ndk-build.cmd)
ndk-build
You should now have the binaries available in ./libs
. (执行结果所在目录)
If you've modified the shared library, you'll also need to build that.(这个我还没试)
Make 编译cmd在minicap目录下执行make。如果不熟悉make命令,可以参考:http://www.cnblogs.com/kissfu/p/6343967.html。
makefile文件做了一些windows 系统的适应。
.PHONY: default clean prebuilt test NDKBUILT := \
libs/arm64-v8a/minicap \
libs/arm64-v8a/minicap-nopie \
libs/armeabi-v7a/minicap \
libs/armeabi-v7a/minicap-nopie \
libs/x86/minicap \
libs/x86/minicap-nopie \
libs/x86_64/minicap \
libs/x86_64/minicap-nopie \ default: prebuilt clean:
ndk-build clean
rm -rf prebuilt $(NDKBUILT):
ndk-build test:
@if exist "prebuilt/armeabi-v7a/bin" echo "ddd"
@if not exist "prebuilt/armeabi-v7a/bin1" echo "ddd1" # It may feel a bit redundant to list everything here. However it also
# acts as a safeguard to make sure that we really are including everything
# that is supposed to be there.
prebuilt: \
prebuilt/armeabi-v7a/bin/minicap \
prebuilt/armeabi-v7a/bin/minicap-nopie \
prebuilt/armeabi-v7a/lib/android-9/minicap.so \
prebuilt/armeabi-v7a/lib/android-10/minicap.so \
prebuilt/armeabi-v7a/lib/android-14/minicap.so \
prebuilt/armeabi-v7a/lib/android-15/minicap.so \
prebuilt/armeabi-v7a/lib/android-16/minicap.so \
prebuilt/armeabi-v7a/lib/android-17/minicap.so \
prebuilt/armeabi-v7a/lib/android-18/minicap.so \
prebuilt/armeabi-v7a/lib/android-19/minicap.so \
prebuilt/armeabi-v7a/lib/android-21/minicap.so \
prebuilt/armeabi-v7a/lib/android-22/minicap.so \
prebuilt/armeabi-v7a/lib/android-23/minicap.so \
prebuilt/armeabi-v7a/lib/android-24/minicap.so \
prebuilt/armeabi-v7a/lib/android-25/minicap.so \
prebuilt/arm64-v8a/bin/minicap \
prebuilt/arm64-v8a/bin/minicap-nopie \
prebuilt/arm64-v8a/lib/android-21/minicap.so \
prebuilt/arm64-v8a/lib/android-22/minicap.so \
prebuilt/arm64-v8a/lib/android-23/minicap.so \
prebuilt/arm64-v8a/lib/android-24/minicap.so \
prebuilt/arm64-v8a/lib/android-25/minicap.so \
prebuilt/x86/bin/minicap \
prebuilt/x86/bin/minicap-nopie \
prebuilt/x86/lib/android-14/minicap.so \
prebuilt/x86/lib/android-15/minicap.so \
prebuilt/x86/lib/android-16/minicap.so \
prebuilt/x86/lib/android-17/minicap.so \
prebuilt/x86/lib/android-18/minicap.so \
prebuilt/x86/lib/android-19/minicap.so \
prebuilt/x86/lib/android-21/minicap.so \
prebuilt/x86/lib/android-22/minicap.so \
prebuilt/x86/lib/android-23/minicap.so \
prebuilt/x86/lib/android-24/minicap.so \
prebuilt/x86/lib/android-25/minicap.so \
prebuilt/x86_64/bin/minicap \
prebuilt/x86_64/bin/minicap-nopie \
prebuilt/x86_64/lib/android-21/minicap.so \
prebuilt/x86_64/lib/android-22/minicap.so \
prebuilt/x86_64/lib/android-23/minicap.so \
prebuilt/x86_64/lib/android-24/minicap.so \
prebuilt/x86_64/lib/android-25/minicap.so \ prebuilt/%/bin/minicap: libs\%\minicap
if not exist "$(@D)" mkdir "$(@D)"
copy "$^" "$@" prebuilt/%/bin/minicap-nopie: libs\%\minicap-nopie
if not exist "$(@D)" mkdir "$(@D)"
copy "$^" "$@" prebuilt/armeabi-v7a/lib/%/minicap.so: jni\minicap-shared\aosp\libs\%\armeabi-v7a\minicap.so
if not exist "$(@D)" mkdir "$(@D)"
copy "$^" "$@" prebuilt/arm64-v8a/lib/%/minicap.so: jni\minicap-shared\aosp\libs\%/arm64-v8a\minicap.so #目标:前置条件("/"改为"\")
if not exist "$(@D)" mkdir "$(@D)" #路径需要加引号,目标的目录 如果不存在创建目录。
copy "$^" "$@" #所有前置条件 目标 ,$(@D) 和 $(@F) 分别指向 $@ 的目录名和文件名 prebuilt/x86/lib/%/minicap.so: jni\minicap-shared\aosp\libs\%\x86\minicap.so
if not exist "$(@D)" mkdir "$(@D)"
copy "$^" "$@" prebuilt/x86_64/lib/%/minicap.so: jni\minicap-shared\aosp\libs\%\x86_64\minicap.so
if not exist "$(@D)" mkdir "$(@D)"
copy "$^" "$@"