Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When debugging in device with ART enabled, android app is slow

i dont know why but a week ago when i am debugging my app in android studio, the app in device is very slow, but if a generate the APK or use the play (Not debug) option works fine..

Anyone have idea why? I think i didnt any change in sdk or in the app to do it this..

like image 961
colymore Avatar asked Apr 25 '14 18:04

colymore


People also ask

Can I run debug APK on device?

apk file is just recreated without debugger and additional tools that Android Studio wants. Now this file can be installed successfully if you share this file to any device.

How do I enable debug on APK?

To start debugging an APK, click Profile or debug APK from the Android Studio Welcome screen. Or, if you already have a project open, click File > Profile or Debug APK from the menu bar. In the next dialog window, select the APK you want to import into Android Studio and click OK.


1 Answers

When ART is enabled, the device cannot ensure the compiled code matches the bytecode instructions. It therefore cannot step through instructions and therefore lines.

This forces the device to fallback to a very slow interpreter, which possibly doesn't even JIT-compile.

For faster debugging, switch back to Dalvik.

like image 81
tilpner Avatar answered Oct 04 '22 17:10

tilpner