如何在更改 Android 源文件后重建 Android 源代码
我的系统中有 android 源代码并且运行良好。但是当我在 android 源文件中进行一些更改并运行“make”时,它不会生成/更新任何文件 如果我错了,请纠正我,
i) 如果对其源代码进行了更改,系统应该生成一个新的 system.img 文件
ii) android 内核文件 -zImage 文件不会随任何更改而更改,即使我们对源代码
另一个问题是,如果我在 /libcore 中创建一个新的库文件夹,它会在编译时自动选取。为了在 /libcore 之外创建新的库文件夹,我在 /build/core/main.mk 和 .classpath 文件中添加了它的路径。在编译过程中仍然没有被拾取。有人可以确认我们必须在哪里进行更改才能在 /libcore 之外添加新的库文件吗
? 约格什
I have android source code in my system and it works fine. But when i make some changes in android source files and run "make" it doesn't generate/update any files
Please correct me if i am wrong,
i) system should generate a new system.img file if changes have been made to its source code
ii) android kernel file-zImage file doesn't change with any change even if we make any changes to the source code
Another question if i create a new library folder inside /libcore it gets automatically picked up when compiling. For creating a new library folder outside /libcore i added its path in /build/core/main.mk and .classpath file. Still its not getting picked up during compilation. Can someone please confirm where all we have to make changes for adding a new library file outside /libcore
Regards,
Yogesh
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这取决于您已签出的确切存储库。但对于大多数人来说,以下食谱将起作用:
http://source.android.com/source /download.html
请注意,如果您使用的是最新版本,则必须具有 64 位系统
更新:由于某种原因,上面的页面缺少一些重要步骤。因此,它们
在您完成“回购同步”步骤后(需要一段时间,但我假设您已经完成了,因为您拥有源文件),请执行以下操作:
最后一个命令将为您提供所需平台的选项列表建造。如果您想为模拟器构建,请选择 full-eng。否则,请为您的特定设备供应商选择一个。
选择平台后,请确保您首先做好所有准备工作,因为整个 Android 平台是非常相互依赖的。因此,您需要确保拥有所有组件。
开发时,您可以非常快速地构建单独的组件。通过使用以下命令:
例如:
另外,构建系统不会更改将输出和中间文件与源代码一起放置。一切都进入 out/target 目录。
This depends on exact repository that you have checked out. But for majority of them the following recipe will work:
http://source.android.com/source/download.html
Note, if you are using the most recent build you must have 64-bit system
UPDATE: For some reason the page above is missing some vital steps. So here they are
After you done 'repo sync' step ( takes a while, but I assume that you did since you have the source files ), do the following:
The last command will give you a list of options for which platform you want to build. If you want to build for the emulator choose full-eng. Otherwise choose one for your specific device vendor.
After choosing the platform make sure you do full make of everything first, because the entire android platform is very interdependent. So you need to make sure you have all the components.
When developing you can build individual components pretty fast. By using the following command:
For example:
Also, the build system does not change put the output and intermediate files with the source code. Everything goes into out/target directory.
这取决于您想要做出的改变。
在一个简单的情况下,如果更改是本地的(例如,将一些新行添加到名为
xxx.c
的现有 android 源文件中),您可以轻松运行:在其他情况下,例如,您创建一个新的系统服务将取代在启动时启动的旧系统服务,如
init.rc
文件中所示。然后,您可能需要:init.rc
文件It depends on the change you want to make.
In an easy case, if the change is local (e.g., adding some new lines into an existing android source files called
xxx.c
), you can easily run:In other cases, say, you create a new system service to replace the old one which is started at boot-up time as shown in
init.rc
file. Then, you probably need to:init.rc
file