一.单独编译HelloWorld(如果没有HelloWorld项目可以使用~/androidsrc2.3.5_r1/packages/apps/Camera/
1.修改Android.mk文件如下.
Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := HelloAndroid
LOCAL_SDK_VERSION := current
include $(BUILD_PACKAGE)
# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))
2.创建脚步initpath.sh.
vim initpath.sh
initpath.sh
#!/bin/bash
#initpan.sh
. ~/androidsrc2.3.5_r1/build/envsetup.sh
export PATH=$PATH:~/androidsrc2.3.5_r1/out/host/linux-x86/bin
export ANDROID_PRODUCT_OUT=~/androidsrc2.3.5_r1/out/target/product/generic
cat initpath.sh
#~/androidsrc2.3.5_r1/out/target/product/generic/
#~/androidsrc2.3.5_r1/packages/experimental/ #调试源码包
#~/androidsrc2.3.5_r1/packages/apps/ #应用源码包
#~/androidsrc2.3.5_r1/out/target/product/generic/system/app/ #apk文件
#~/androidsrc2.3.5_r1/out/target/product/generic/system/bin/ #可执行文件
#~/androidsrc2.3.5_r1/out/target/product/generic/system/lib/ #动态链接库文件
#~/androidsrc2.3.5_r1/out/target/product/generic/system/lib/hw/ #HAL接口文件
3.单独编译HelloWorld模块
chmod 777 initpath.sh
./initpath.sh
mmm ./packages/experimental/HelloAndroid/
//mmm ~/androidsrc2.3.5_r1/packages/apps/Camera/
make snod
emulator
#######~/androidsrc2.3.5_r1/packages/experimental/HelloAndroid/ =======编译后>>>>>>
//~/androidsrc2.3.5_r1/packages/apps/Camera/
~/androidsrc2.3.5_r1/out/target/product/generic/system/app/HelloAndroid.jpk
// ~/androidsrc2.3.5_r1/out/target/product/generic/system/app/Camera.jpk