Android源框架修改了重建,但在模拟器中有效 [英] Android source framework modify rebuild but become effective in emulator
问题描述
我修改/framework/base/services/core/java/com/android/server/am/ActivityManagerService.java 一些logcat输出字符串.
i modify /framework/base/services/core/java/com/android/server/am/ActivityManagerService.java some logcat output string.
并且我尝试使用不同的方式来重建它:
and i try to use different ways to rebuild it:
制作-jN 或
mmm/framework/base -jN 或
mmm/framework/base/services -jN
然后我在/out/target/product/generic_x86/system/framework/x86/services.odex
然后我通过 make snod
然后我尝试重新启动模拟器,或 adb重新安装adb同步,或终止system_server进程
then i try to restart emulator, or adb remount adb sync, or kill system_server process
但是可悲的是,无论我使用哪种方法,仿真器总是输出原始字符串.(很生气)
but sadly, no matter what kinds of methods i use, the emulator always output the original string.(so angry)
我什至提取了新的输出system.img以获取新的services.odex文件,并使用oat2dex.jar将其反编译为Java代码,我确实看到其中的字符串已更改.
i even extract the new output system.img to get the new services.odex file, and use oat2dex.jar to decompile it to java code, and i indeed see the string has changed in it.
所以为什么当我运行模拟器时,它不会生效...
so why when i run the emulator, it won't become effective...
推荐答案
模拟器使用的系统映像文件为system-qemu.img
.
由于某种原因,文件不是由make snod
创建的,而仅由system.img
创建.我认为需要的是其他目标,因此您可以说make qsnod
之类的,但似乎没有.我不知道任何人都可以这样工作.
The system image file used by the emulator is system-qemu.img
.
For some reason that file isn't made by make snod
, which only makes system.img
. I think what is needed is an additional target so you could say make qsnod
or something, but there doesn't seem to be one. I don't know how anyone can work like this.
我目前对Makefile的结构还不够了解,无法弄清楚如何添加qsnod
目标,但这是手动滚动的一种方法
system-qemu.img
.
I don't understand the Makefile structure well enough at this point to figure out how to add a qsnod
target, but here's a way to hand-roll
system-qemu.img
.
请注意,make -nN
报告的最后一步是:
Notice that the very last step that make -nN
reports is:
[100% 255/255] Create system-qemu.img
要找出在此运行的命令,可以说make showcommands -jN
.我这样做了,发现在Macbook Pro上是以下内容:
To find out what command it ran there, you can say make showcommands -jN
. I did this, and found it was the following, on my Macbook Pro:
[100% 255/255] /bin/bash -c "(export SGDISK=out/host/darwin-x86/bin/sgdisk; device/generic/goldfish/tools/mk_qemu_image.sh out/target/product/generic_x86_64/system.img)"
这就是从输入system.img
产生system-qemu.img
的命令(这是make snod
产生的).
So that's the command for making system-qemu.img
from input system.img
(which is what make snod
makes).
因此,在更改Framework/base下的.java文件后,在我的计算机上重建system.img
的方法是:
So, my recipe for rebuilding system.img
on my machine, after changing a .java file under framework/base, is:
mmm frameworks/base -jN
make snod -jN
SGDISK=out/host/darwin-x86/bin/sgdisk device/generic/goldfish/tools/mk_qemu_image.sh out/target/product/generic_x86_64/system.img
然后,当我重新启动仿真器时,我看到更改已生效.
Then when I restart the emulator, I see that my change has taken effect.
这篇关于Android源框架修改了重建,但在模拟器中有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!