进入External Tools界面:
javah
Program:$JDKPath$/bin/javah
Parameters:-encoding UTF-8 -d ../jni -jni $FileClass$
Working directory:$ModuleFileDir$/src/main/java
ndk-build
Program:/Users/megvii/Library/Android/sdk/ndk-bundle/build/ndk-build(ndk目录/build/ndk-build)
Parameters:无需填写
Working directory:$ModuleFileDir$/src/main
ndk-build clean
Program:/Users/megvii/Library/Android/sdk/ndk-bundle/build/ndk-build(同上)
Parameters:clean
Working directory:$ModuleFileDir$/src/main
效果如图:
以后编译无需繁琐的操作