How can I detect the Android runtime (Dalvik or ART)?

前端 未结 6 1103
长情又很酷
长情又很酷 2021-01-30 13:22

Google added a new ART runtime with Android 4.4. How can I determine whether ART or Dalvik is the current runtime?

6条回答
  •  清酒与你
    2021-01-30 14:16

    I think you should be able to use System.getProperty with java.vm.name as the key. In the JavaDoc its value is Dalvik, which let's hope it is Art or ART when using that runtime. It's worth a try...

提交回复
热议问题