Modify source code efficiency

本文档详细介绍了如何编译Froyo(Android 2.2)源代码,并提供了替换系统镜像文件system.img和userdata.img的方法。此外,还指导了如何修改应用程序如Contacts以及系统框架文件来实现定制化的Android系统。

这是做framework开发时我未team member写的training doc,与大家分享一下

1. compile froyo source code use make

#cdfroyo

#make #wait 3 hours

2. use the new system.img and userdata.img instead of the sdk's img,backup first

#mv /yournamedir/android-sdk-linux_86/platforms/android-8/images/system.img /yournamedir/android-sdk-linux_86/platforms/android-8/images/system.img.old

#mv /yournamedir/android-sdk-linux_86/platforms/android-8/images/userdata.img

/yournamedir/android-sdk-linux_86/platforms/android-8/images/userdata.img.old

#ln -s 7015/out/target/product/generic/system.img /yournamedir/android-sdk-linux_86/platforms/android-8/images/system.img

#ln -s 7015/out/target/product/generic/userdata.img /yournamedir/android-sdk-linux_86/platforms/android-8/images/userdata.img

then create a avd in eclipse, this avd will use the new system.img.

Start it!

3. modify apps

Change Contacts for example,change java files in packages and save.

#cd 7015

#mmm packages/apps/Contacts #wait sevaral minutes

#adb remount #after remount the /symstem in emulator will be mounted writable

use the new generated apk replace the same apk in emulator dir /system/app,you can use adb push command or push file in ddms.

#adb push out/target/product/generic/system/app/Contacts.apk /system/app

#adb push out/target/product/generic/data/app/ContactsTests.apk /system/app

4. modify framework files

Change frameworks/base/core/res/ for example

edit String.xml and save

#mmm frameworks/base/core/res/

this will generate out/target/product/generic/system/framework/framework-res.apk, then use mkyaffs2image make new system.img

#out/host/linux-x86/bin/mkyaffs2image -f out/target/product/generic/system out/target/product/generic/system.img

restart the emulator, the new system.img will be used.

x30076778@DESKTOP-PUO6BMI MINGW64 /d/xingrufeng/code_src/8911SDK/code_sd8911_git/hlt/build/sd8911_llt (br_odspTX) $ ./build_and_execute.sh hidsp0 build ; # build without clean TDP env is null, set to default dir: /d/xingrufeng/code_src/8911SDK/code_sd8911_git/hlt/build/sd8911_llt/hidsp0_llt_result use lib: C:/usr1/local/lib/libgtest.a C:/usr1/local/lib/libmockcpp.a Begin to build 8911 sdk.exe [build] current path len:56 你没有足够的权限执行此操作。 [build] change long current path:/d/xingrufeng/code_src/8911SDK/code_sd8911_git/hlt/build to D:/wecode_project_link/86516724/hlt/build [build] Warnning: The compilation efficiency will reduced when the project path is too long. [build] Warnning: The compilation efficiency will reduced when the project path is too long. [build] Warnning: The compilation efficiency will reduced when the project path is too long. [build] Warnning: It is suggested to modify the project directory. [build] BUILD_WORK_DIR=D:/wecode_project_link/86516724/hlt/build/../../src/../hlt/work/sd8911_hidsp0_llt/mingw_gdb [build] OUTPUT_DIR=D:/wecode_project_link/86516724/hlt/build/../../src/../hlt/work/sd8911_hidsp0_llt/mingw_gdb [build] Parallel job num is 50 1.10.0 [build] MAKEFILE_GENERRATOR=Ninja [build] TARGET_NAME=sdk.exe CMake Error: The source directory "D:/wecode_project_link/86516724/hlt" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. [build] ninja sdk -j50 ... ninja: error: loading 'build.ninja': ϵͳ▒Ҳ▒▒▒ָ▒▒▒▒▒ļ▒▒▒ ls: cannot access 'D:/wecode_project_link/86516724/hlt/build/../../src/../hlt/work/sd8911_hidsp0_llt/mingw_gdb/sdk.exe': No such file or directory ================ building error ================ Binary file make.log matches [build] make build end. ls: cannot access '/d/xingrufeng/code_src/8911SDK/code_sd8911_git/hlt/build/sd8911_llt/../../work/sd8911_hidsp0_llt/mingw_gdb/sdk.exe': No such file or directory [build] Warnning: It is suggested to modify the project directory. [build] BUILD_WORK_DIR=D:/wecode_project_link/86516724/hlt/build/../../src/../hlt/work/sd8911_hidsp0_llt/mingw_gdb [build] OUTPUT_DIR=D:/wecode_project_link/86516724/hlt/build/../../src/../hlt/work/sd8911_hidsp0_llt/mingw_gdb [build] Parallel job num is 50 1.10.0 [build] MAKEFILE_GENERRATOR=Ninja [build] TARGET_NAME=sdk.exe CMake Error: The source directory "D:/wecode_project_link/86516724/hlt" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. [build] ninja sdk -j50 ... Binary file BUILD.LOG matches For more detailed information, please check ./BUILD.LOG. Build Fail! 什么意思
09-05
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值