如何编译 Dalvik 以在 Linux 上本地运行它?
在 Linux 上编译和运行 Dalvik 虚拟机所需的最少步骤是什么(包括检索源代码)?
What are the minimal steps necessary (including retrieving the source code) to compile and run just the Dalvik virtual machine on Linux?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
事实上,我让 Dalvik 开始安装我的基本操作系统。
首先使用 https://source.android.com/source/downloading.html 下载 Android AOSP 源代码树。等待它下载(我只克隆当前提交和 Marshmallow 分支需要 2 个小时)
在源代码树中运行
build/envsetup.sh
后运行lunch full_x86-eng 。然后输入 make -jN(将 N 替换为核心数)。
等待。我在 AMD-4500M 笔记本电脑上花了大约 1 个小时。较新的计算机可能只需半个小时,而较旧的计算机可能需要半天。
将目录更改为
!!AOSP-PATH!!/out/host/linux-x86/bin/
并运行export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:!!AOSP-PATH!!/out/host /linux-x86/obj/lib/
或export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:!!AOSP-PATH!!/out/host/linux-x86/lib
或
export LD_LIBRARY_PATH =$LD_LIBRARY_PATH:!!AOSP-PATH!!/out/host/linux-x86/lib64
尝试所有这些
,然后
./dalvikvm --32
。如果您尝试在没有--32
选项的情况下运行,它将崩溃(不知道为什么)正在工作的 Marshmallow Dalvik。为了让 GUI 应用程序正常工作,您将需要进行更多的移植和编码,这是我正在从事的另一个项目。
我花了半天时间才弄清楚这个问题。
参考文献
http://milk.com/kodebase/dalvik-docs-镜像/docs/hello-world.html
Actually , I got Dalvik working on my elementary OS installation.
First download the Android AOSP source tree using https://source.android.com/source/downloading.html. Wait for it to download (2 hours for me cloning only the current commits and Marshmallow branch)
After running
build/envsetup.sh
while in the source tree runlunch full_x86-eng
. Then typemake -jN
(replace N with number of cores).WAIT. This took me about 1 hour on an AMD-4500M laptop. Newer ccomputers may be as low as half and hour and older ones might take half a day.
Change directory to
!!AOSP-PATH!!/out/host/linux-x86/bin/
and runexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:!!AOSP-PATH!!/out/host/linux-x86/obj/lib/
orexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:!!AOSP-PATH!!/out/host/linux-x86/lib
or
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:!!AOSP-PATH!!/out/host/linux-x86/lib64
TRY ALL OF THESE
and then
./dalvikvm --32
. If you try to run without the--32
option it will crash (don't know why)Working Marshmallow Dalvik. To get the GUI apps working you will need to do some more porting and coding which is another project which I am working on.
Took me half a day to figure this out.
References
http://milk.com/kodebase/dalvik-docs-mirror/docs/hello-world.html
使用 sabayon Linux。这是一个可以原生运行 Android 程序和所有 Linux 程序的发行版。
Use sabayon Linux. This is a distro that can natively run Android programs and all Linux ones too.
实际上,这更像是运行在Dalvik上的android,底层系统已经是linux了。
我想在桌面 Linux 机器上运行裸露的 Dalvik VM 只需要获取源代码并编译它即可。
GUI 的东西是另外一回事。
Actually, that's rather android running on Dalvik and the underlying system is already linux.
I guess running a bare Dalvik VM on a desktop linux box is just a matter of getting the sources and compile it.
The GUI stuff is something else.
你并不是唯一一个有这个想法的人,这从互联网社会的角度来看是很棒的。
这可能就是您正在寻找的内容:http://www.android-x86.org/。
那些人将 android 移植到了 x86。
它仍然可以作为操作系统使用,所以我不确定是否可以在不使用 VirtualBox 的情况下同时运行 Linux 和 Android(Linux)。
You are not the only one with this idea, and that is great in internet society terms.
This is probably what you are looking for: http://www.android-x86.org/.
Those guys ported android over to x86.
It still works as an OS, so I'm not sure if you can run Linux and Android(Linux) together without using VirtualBox.
Dalvik 在 Android 上运行。据我们所知,Dalvik 的作者只担心它在 Android 上运行。
多个组织表示他们正在努力将 Dalvik 移出 Android。您最好找到他们并与他们交谈。
换句话说,没有您寻求的类型的官方说明。
对不起!
Dalvik runs on Android. The authors of Dalvik are only worrying about it running on Android, as far as we are aware.
Various groups have indicated they are working on getting Dalvik outside of Android. You are probably best off finding and talking to them.
In other words, there are no official instructions of the type you seek.
Sorry!
让专为 Android 设计的应用程序在 Linux 上运行将会很棘手。但是,可以在 Linux 上运行 Dalvik VM。事实上,这个 GitHub 项目 有一个预编译的 Dalvik VM 二进制文件,用于Linux,准备使用!检查相关的博客文章有关如何编译二进制文件以及如何使用它的信息。
Getting apps designed for Android to run on Linux is going to be tricky. However, it is possible to run a Dalvik VM on Linux. In fact, this GitHub project has a pre-compiled binary of Dalvik VM for Linux, ready to use! Check the associated blog post for information about how the binary was compiled and how to use it.
学习编程 Java \ C \ C++ 和其他框架
修改 Android 源代码(我认为是 app_process 或其他东西),以便它在 Linux 桌面上显示一个窗口(学习 X11 / Wayland API)
下面是一个简单的基础,供您从
www. android-x86.org/getsourcecode
获取 Android-x86 源代码
首先,按照此页面配置您的构建环境。然后
其中 $branch 是上一节中描述的任何分支名称。这会将 android-x86 创建或修改的项目指向我们的 git 服务器。所有其他项目仍然指向 AOSP。
我们在 SourceForge.net 上也有一个 git 镜像服务器。使用时只需将repo init命令改为
Learn to program Java \ C \ C++ and other frameworks
Modify the Android source (I think app_process or something) so it shows a windows on the Linux desktop (learn X11 / Wayland APIs)
Below is a simpile base for you to start with
www.android-x86.org/getsourcecode
Getting Android-x86 source code
First, follow this page to configure your build environment. Then
Where $branch is any branch name described in the previous section. This will point the projects created or modified by android-x86 to our git server. All the other projects still point to AOSP.
We also have a git mirror server on SourceForge.net. To use it, you only need to change the repo init command to