Android 命令行手动编译打包详解
2010-08-11 10:56:00 来源:WEB开发网Android 命令行手动编译打包过程图

【详细步骤】:
1使用aapt生成R.java类文件:
例:
F:explorerandroid-sdk-windows2.2 ools>f:explorerandroid-sdk-windows2.2platformsandroid-3 oolsaapt.exe package -f -m -J F:explorerAndroidByreadgen -S res -I f:explorerandroid-sdk-windows2.2platformsandroid-3android.jar -M AndroidManifest.xml
其中 -f -m -J F:explorerAndroidByreadgen 代表按覆盖的形式在gen目录下生成带包路径的R.java,-S res指定资源文件 ,-I f:explorerandroid-sdk-windows2.2platformsandroid-3android.jar 指定使用的android类,-M AndroidManifest.xml指定程序的配置文件
aapt Usage:

2使用android SDK提供的aidl.exe把.aidl转成.java文件:
usage: aidl OPTIONS INPUT [OUTPUT]
aidl --preprocess OUTPUT INPUT...
OPTIONS:
-I
-d
-p
-o
-b fail when trying to compile a parcelable.
INPUT:
An aidl interface file.
OUTPUT:
The generated interface files.
3第三步 编译.java类文件生成class文件:
例:F:explorerAndroidByread>javac -encoding GB18030 -target 1.5 -bootclasspath F:explorerandroid-sdk-windows2.2platformsandroid-3android.jar -d bin srccomyreadeader*.java gencomyreadeaderR.java

4使用android SDK提供的dx.bat命令行脚本生成classes.dex文件:

更多精彩
赞助商链接