Android 命令行编译、打包生成apk文件
- - CSDN博客移动开发推荐文章安装JDK 和 Android SDK. 项目目录:D:\ProjectDemo. SDK目录 :D:\android-sdk-windows\platforms\android-8\. 二、命令行编译Android项目. Java代码生成class文件. aapt命令, 生成R文件. -f 如果编译生成的文件已经存在,强制覆盖.
> aapt package -f -m -J ./gen -S res -M AndroidManifest.xml -I D:\android.jar
> javac -target 1.5 -bootclasspath D:\android-sdk-windows\platforms\android-8\android.jar -d bin src\demo\project\*.java gen\demo\project\R.java
> dx --dex --output=D:\ProjectDemo\bin\classes.dex D:\ProjectDemo\bin
> aapt package -f -M AndroidManifest.xml -S res -I D:\android-sdk-windows\platforms\android-8\android.jar -F bin\resources.ap_
apkbuilder D:\ProjectDemo\bin\projectdemo.apk -v -u -z D:\ProjectDemo\bin\resources.ap_ -f D:\ProjectDemo\bin\classes.dex -rf D:\ProjectDemo\src
>keytool -genkey -alias release -keyalg RSA -validity 20000 -keystore release.keystore
jarsigner -verbose -keystore C:\Users\UserName\Desktop\build\release.keystore -storepass antmima -keypass antmima -signedjar D:\ProjectDemo\bin\projectdemo-signed.apk D:\ProjectDemo\bin\projectdemo.apk release