android platfrom,Dalvik 字节码或本机机器码过程中的哪种代码?
Which kind of code in the process of android platfrom, Dalvik byte-codes or native machine code?
我不太确定 android 平台上的 linux 进程中加载了哪种代码。
如果android采用Dalvik,进程中包含一个Dalvik VM和应用程序的代码,代码是Dalvik字节码形式吗?如果是,代码是否与.apk文件中的classes.dex相同?
如果android采用Android Runtime (ART),由于classes.dex已经翻译成native机器码,所以我认为app的代码在Linux process 不会是 Dalvik 字节码,而是本地机器码。如果我的理解是正确的,那么进程中是否还包含Dalvik VM?
从 Android 5.0(Lollipop) 开始,Dalvik 已完全替换为 Android Runtime(ART),它处理 native 二进制文件。
Verifying App Behavior on the Android Runtime
The Android runtime (ART) is the default runtime for devices running Android 5.0 (API level 21) and higher.
At install time, ART compiles apps using the on-device dex2oat tool. This utility accepts DEX files as input and generates a compiled app executable for the target device
更具体地说,Dalvik 提倡使用 odex 文件,这些文件是 dex 文件的预处理优化版本,供 Dalvik 解释或 JIT 编译。
ART 提倡使用 ELF 文件,这是一种通用格式,可指导将某些功能和对象链接到设备的本机指令,并在安装时执行。
Unlike Dalvik, ART introduces the use of ahead-of-time (AOT) compilation by compiling entire applications into native machine code upon their installation.
ART uses the same input bytecode as Dalvik, supplied through standard .dex files as part of APK files, while the .odex files are replaced with Executable and Linkable Format (ELF) executables. Once an application is compiled by using ART's on-device dex2oat utility, it is run solely from the compiled ELF executable
Executable and Linkable Format - Applications
Android uses ELF .so (shared object) libraries for the Java Native Interface. With Android Runtime (ART), the default since Android 5.0 "Lollipop", all applications are compiled into native ELF binaries on installation
ART 不包含 Dalvik 实例,尽管大部分兼容,但提到了 ART 不支持 Dalvik 支持的某些功能。
Verifying App Behavior on the Android Runtime
However, some techniques that work on Dalvik do not work on ART. This document lets you know about things to watch for when migrating an existing app to be compatible with ART. Most apps should just work when running with ART.
我不太确定 android 平台上的 linux 进程中加载了哪种代码。
如果android采用Dalvik,进程中包含一个Dalvik VM和应用程序的代码,代码是Dalvik字节码形式吗?如果是,代码是否与.apk文件中的classes.dex相同?
如果android采用Android Runtime (ART),由于classes.dex已经翻译成native机器码,所以我认为app的代码在Linux process 不会是 Dalvik 字节码,而是本地机器码。如果我的理解是正确的,那么进程中是否还包含Dalvik VM?
从 Android 5.0(Lollipop) 开始,Dalvik 已完全替换为 Android Runtime(ART),它处理 native 二进制文件。
Verifying App Behavior on the Android Runtime
The Android runtime (ART) is the default runtime for devices running Android 5.0 (API level 21) and higher.
At install time, ART compiles apps using the on-device dex2oat tool. This utility accepts DEX files as input and generates a compiled app executable for the target device
更具体地说,Dalvik 提倡使用 odex 文件,这些文件是 dex 文件的预处理优化版本,供 Dalvik 解释或 JIT 编译。
ART 提倡使用 ELF 文件,这是一种通用格式,可指导将某些功能和对象链接到设备的本机指令,并在安装时执行。
Unlike Dalvik, ART introduces the use of ahead-of-time (AOT) compilation by compiling entire applications into native machine code upon their installation.
ART uses the same input bytecode as Dalvik, supplied through standard .dex files as part of APK files, while the .odex files are replaced with Executable and Linkable Format (ELF) executables. Once an application is compiled by using ART's on-device dex2oat utility, it is run solely from the compiled ELF executable
Executable and Linkable Format - Applications
Android uses ELF .so (shared object) libraries for the Java Native Interface. With Android Runtime (ART), the default since Android 5.0 "Lollipop", all applications are compiled into native ELF binaries on installation
ART 不包含 Dalvik 实例,尽管大部分兼容,但提到了 ART 不支持 Dalvik 支持的某些功能。
Verifying App Behavior on the Android Runtime
However, some techniques that work on Dalvik do not work on ART. This document lets you know about things to watch for when migrating an existing app to be compatible with ART. Most apps should just work when running with ART.