![]() Hi Dear MIUI Fan's! Today i'll show you how to Optimize all APP for running it faster, smoother and with less battery power! I'm not Android developer but i try explain all with simple word for better understanding for normal user. If you are ready than i can start!)) Foreword To this moment your device use ART JIT Compiler for running apps. ART JIT - is a Android Runtime Just in Time. This mean Android compile code every time for running app.
But ART have profile compiler AOT (Ahead of Time) and he is not activate for app in android, but you can activate it from ADB SHELL. Profile-guided compilation. 1.The user runs the app, which then triggers ART to load the .dex file.
2. JIT is enabled for any application that is not compiled according to the speed compilation filter (which says "compile as much as you can from the app"). 3. The JIT profile data is dumped to a file in a system directory that only the application can access. 4. The AOT compilation (dex2oat) daemon parses that file to drive its compilation. And now let's look at the pros and cons: Pros: - Run APP faster - Use less power Cons: - Applications install a little longer (but not very noticeably) - Use more storage !!!Warning!!! This is not recomend to use on device with 16\32 GB storage If briefly the following commands make it possible to compile the code into an offline profile (.aot file) to run applications. Do not forget!! The more applications installed, the more space will be taken after a new compilation. Here is a resoult Tutorial Download Platform-tools and run CMD from folder Platform-tool Enable USB Debugging and USB debugging Secure Settings in Developer options your device. To force compilation, run the following: adb shell cmd package compile Common use cases for force compiling a specific package: My-Package is apk name from Settings ![]() ![]() Example command If command right and all ok, you will see Success word after commandadb shell cmd package compile -m speed -f com.tencent.mobileqq
adb shell cmd package compile -m speed -f my-package Common use cases for force compiling all packages:
adb shell cmd package compile -m speed -f -a Example i compile all APP ![]() Clearing profile data (revert all back) To clear profile data and remove compiled code, run the following with ROOT: su
adb shell cmd package compile --reset my-package
adb shell cmd package compile --reset -a Thanks to all for your time! Also thanks to Admin MIUI Community! Related thread: |
Rate
-
Number of participants 9 Experience +109 Pack Reason