ads
How to Making the most of the APK analyzer.
ads
APK Analyzer helps you to open and look at the contents of any APK report you have got in your pc, either constructed out of your neighborhood Android Studio undertaking or received out of your construct server or other artifact repository. It doesn’t should be constructed from any undertaking you have open in Android Studio and you don’t need the source code for that unique APK.
ads
note: APK Analyzer works great with release builds. if you want to analyze a debug build of your app, ensure you are using an APK that is not instrumented for immediate Run. To attain it, you could use the build → build APKcommand. you may see if you’ve opened an instant Run instrumented APK via checking the presence of an immediate-run.zip report in the archive.
ads
the usage of the APK analyzer is a extremely good way to poke round APK documents and study their structure, verify the file contents earlier than freeing or debug a few common issues, consisting of APK size and DEX problems.
ads
lowering app size with the APK Analyzer
The APK analyzer can give you quite a few beneficial, actionable info about app length. at the pinnacle of the screen, you could see the uncooked document size that is just the APK on-disk size. The down load length suggests an estimate of how a whole lot statistics will used to down load your app with the aid of deliberating compression applied with the aid of the Play shop.
ads
The list of documents and folders is looked after through total size in descending order. This makes it notable for identifying the low putting fruit of APK length optimization. on every occasion you drill down into a folder, you could see the resources and different entities that take up the most space for your APK.
ads
In this case, whilst examining an APK for viable length reductions, i used to be capable of without delay be aware that a 3-body PNG animation is the unmarried biggest thing in our drawable sources, weighing in at 1.5MB, and that’s only for the xxhdpi density!
ads
due to the fact that these pix appear to be best applicants for storing as vectors, we determined the supply documents for the paintings and imported them as VectorDrawables the usage of the brand new PSD guide within the Vector Asset import toolin Android Studio 2.2.
ads
by going thru the identical manner for the alternative closing animation (instruction_touch_*.png) and getting rid of those PNG files across all densities, we have been able to store over 5MB. To preserve backward compatibility we used VectorDrawableCompat from the support library.
ads
looking at different resource folders, it changed into clean to spot some uncompressed WAV documents that might be transformed to OGG, which meant even greater savings without touching a line of code.
subsequent on the listing of things to test become the lib/ folder, which contains native libraries for the 3 ABIs that we aid.
ads
The choice was made to apply APK splits aid in our Gradle construct to create separate versions of the app for each ABI.
ads
I speedy looked over the AndroidManifest.xml subsequent and observed that is missing the android:extractNativeLibs characteristic. placing this attribute to fake can save some space on the device because it prevents copying out the native libraries from the APK to the filesystem. The handiest requirement is that the files are page aligned and stored uncompressed within the APK, that is supported with the brand new packager in the Android Gradle plugin version 2.2.zero+.
ads
We made a number of progress at the resources and native libraries, saving a total of 17MB with very little adjustments inside the app. but, i will see that our DEX length regressed, with the classes2.dex growing with the aid of 400KB.
ads
Debugging DEX problems
In this situation, the difference got here from upgrading our dependencies to newer variations and adding new libraries. Proguard and Multidex were already enabled for our builds so there’s now not much that can be done about our DEX size. nonetheless, APK analyzer is a excellent tool to debug any problems with this setup, particularly while you’re allowing Multidex or Proguard for your challenge for the primary time.
ads
while you click on any DEX document, you will see a precis of what number of classes and methods it defines, and how many total references it incorporates (it’s references that rely in opposition to the 64K limit in a unmarried DEX file). In this example screenshot, the app is pretty much to reach the restrict, this means that it will need MultiDex to cut up the lessons into separate files within the close to future.
ads
you could drill down into the programs to see which of them are the use of up all the references. In this example, we will see that the support library and Google Play offerings are the main causes for this situation:
ads
when you’ve enabled MultiDex and compiled your app, you'll notice a 2d classes2.dex file (and possibly classes3.dex, and so forth). The MultiDex answer within the Android gradle plugin figures out which classes are had to start your app and puts them into the primary training.dex record, however in the rare case when it doesn’t paintings and also you get a ClassNotFoundException, you may use APK Analyzer to investigate the DEX files, after which force the lacking instructions to be positioned within the number one DEX file.
ads
you will come across comparable troubles when allowing Proguard and the use of training or techniques by means of mirrored image or from XML layouts. The APK Analyzer permit you to with verifying that your Proguard configuration is correct, with the aid of letting you effortlessly test if the strategies and instructions you require are present within the APK and if they are being renamed (obfuscated). you can additionally make sure that classes you want gone are in reality eliminated, and no longer taking on your precious reference method rely.
ads
We’re curious to hear what other uses you discover for the APK Analyzer and what other functions you’d want to see integrated within the tool!
ads
APK Analyzer helps you to open and look at the contents of any APK report you have got in your pc, either constructed out of your neighborhood Android Studio undertaking or received out of your construct server or other artifact repository. It doesn’t should be constructed from any undertaking you have open in Android Studio and you don’t need the source code for that unique APK.
ads
note: APK Analyzer works great with release builds. if you want to analyze a debug build of your app, ensure you are using an APK that is not instrumented for immediate Run. To attain it, you could use the build → build APKcommand. you may see if you’ve opened an instant Run instrumented APK via checking the presence of an immediate-run.zip report in the archive.
ads
the usage of the APK analyzer is a extremely good way to poke round APK documents and study their structure, verify the file contents earlier than freeing or debug a few common issues, consisting of APK size and DEX problems.
ads
lowering app size with the APK Analyzer
The APK analyzer can give you quite a few beneficial, actionable info about app length. at the pinnacle of the screen, you could see the uncooked document size that is just the APK on-disk size. The down load length suggests an estimate of how a whole lot statistics will used to down load your app with the aid of deliberating compression applied with the aid of the Play shop.
ads
The list of documents and folders is looked after through total size in descending order. This makes it notable for identifying the low putting fruit of APK length optimization. on every occasion you drill down into a folder, you could see the resources and different entities that take up the most space for your APK.
ads
In this case, whilst examining an APK for viable length reductions, i used to be capable of without delay be aware that a 3-body PNG animation is the unmarried biggest thing in our drawable sources, weighing in at 1.5MB, and that’s only for the xxhdpi density!
ads
due to the fact that these pix appear to be best applicants for storing as vectors, we determined the supply documents for the paintings and imported them as VectorDrawables the usage of the brand new PSD guide within the Vector Asset import toolin Android Studio 2.2.
ads
by going thru the identical manner for the alternative closing animation (instruction_touch_*.png) and getting rid of those PNG files across all densities, we have been able to store over 5MB. To preserve backward compatibility we used VectorDrawableCompat from the support library.
ads
looking at different resource folders, it changed into clean to spot some uncompressed WAV documents that might be transformed to OGG, which meant even greater savings without touching a line of code.
subsequent on the listing of things to test become the lib/ folder, which contains native libraries for the 3 ABIs that we aid.
ads
The choice was made to apply APK splits aid in our Gradle construct to create separate versions of the app for each ABI.
ads
I speedy looked over the AndroidManifest.xml subsequent and observed that is missing the android:extractNativeLibs characteristic. placing this attribute to fake can save some space on the device because it prevents copying out the native libraries from the APK to the filesystem. The handiest requirement is that the files are page aligned and stored uncompressed within the APK, that is supported with the brand new packager in the Android Gradle plugin version 2.2.zero+.
ads
We made a number of progress at the resources and native libraries, saving a total of 17MB with very little adjustments inside the app. but, i will see that our DEX length regressed, with the classes2.dex growing with the aid of 400KB.
ads
Debugging DEX problems
In this situation, the difference got here from upgrading our dependencies to newer variations and adding new libraries. Proguard and Multidex were already enabled for our builds so there’s now not much that can be done about our DEX size. nonetheless, APK analyzer is a excellent tool to debug any problems with this setup, particularly while you’re allowing Multidex or Proguard for your challenge for the primary time.
ads
while you click on any DEX document, you will see a precis of what number of classes and methods it defines, and how many total references it incorporates (it’s references that rely in opposition to the 64K limit in a unmarried DEX file). In this example screenshot, the app is pretty much to reach the restrict, this means that it will need MultiDex to cut up the lessons into separate files within the close to future.
ads
you could drill down into the programs to see which of them are the use of up all the references. In this example, we will see that the support library and Google Play offerings are the main causes for this situation:
ads
when you’ve enabled MultiDex and compiled your app, you'll notice a 2d classes2.dex file (and possibly classes3.dex, and so forth). The MultiDex answer within the Android gradle plugin figures out which classes are had to start your app and puts them into the primary training.dex record, however in the rare case when it doesn’t paintings and also you get a ClassNotFoundException, you may use APK Analyzer to investigate the DEX files, after which force the lacking instructions to be positioned within the number one DEX file.
ads
you will come across comparable troubles when allowing Proguard and the use of training or techniques by means of mirrored image or from XML layouts. The APK Analyzer permit you to with verifying that your Proguard configuration is correct, with the aid of letting you effortlessly test if the strategies and instructions you require are present within the APK and if they are being renamed (obfuscated). you can additionally make sure that classes you want gone are in reality eliminated, and no longer taking on your precious reference method rely.
ads
We’re curious to hear what other uses you discover for the APK Analyzer and what other functions you’d want to see integrated within the tool!
ads
APK Analyzer helps you to open and look at the contents of any APK report you have got in your pc, either constructed out of your neighborhood Android Studio undertaking or received out of your construct server or other artifact repository. It doesn’t should be constructed from any undertaking you have open in Android Studio and you don’t need the source code for that unique APK.
ads
note: APK Analyzer works great with release builds. if you want to analyze a debug build of your app, ensure you are using an APK that is not instrumented for immediate Run. To attain it, you could use the build → build APKcommand. you may see if you’ve opened an instant Run instrumented APK via checking the presence of an immediate-run.zip report in the archive.
ads
the usage of the APK analyzer is a extremely good way to poke round APK documents and study their structure, verify the file contents earlier than freeing or debug a few common issues, consisting of APK size and DEX problems.
ads
lowering app size with the APK Analyzer
The APK analyzer can give you quite a few beneficial, actionable info about app length. at the pinnacle of the screen, you could see the uncooked document size that is just the APK on-disk size. The down load length suggests an estimate of how a whole lot statistics will used to down load your app with the aid of deliberating compression applied with the aid of the Play shop.
ads
The list of documents and folders is looked after through total size in descending order. This makes it notable for identifying the low putting fruit of APK length optimization. on every occasion you drill down into a folder, you could see the resources and different entities that take up the most space for your APK.
ads
In this case, whilst examining an APK for viable length reductions, i used to be capable of without delay be aware that a 3-body PNG animation is the unmarried biggest thing in our drawable sources, weighing in at 1.5MB, and that’s only for the xxhdpi density!
ads
due to the fact that these pix appear to be best applicants for storing as vectors, we determined the supply documents for the paintings and imported them as VectorDrawables the usage of the brand new PSD guide within the Vector Asset import toolin Android Studio 2.2.
ads
by going thru the identical manner for the alternative closing animation (instruction_touch_*.png) and getting rid of those PNG files across all densities, we have been able to store over 5MB. To preserve backward compatibility we used VectorDrawableCompat from the support library.
ads
looking at different resource folders, it changed into clean to spot some uncompressed WAV documents that might be transformed to OGG, which meant even greater savings without touching a line of code.
subsequent on the listing of things to test become the lib/ folder, which contains native libraries for the 3 ABIs that we aid.
ads
The choice was made to apply APK splits aid in our Gradle construct to create separate versions of the app for each ABI.
ads
I speedy looked over the AndroidManifest.xml subsequent and observed that is missing the android:extractNativeLibs characteristic. placing this attribute to fake can save some space on the device because it prevents copying out the native libraries from the APK to the filesystem. The handiest requirement is that the files are page aligned and stored uncompressed within the APK, that is supported with the brand new packager in the Android Gradle plugin version 2.2.zero+.
ads
We made a number of progress at the resources and native libraries, saving a total of 17MB with very little adjustments inside the app. but, i will see that our DEX length regressed, with the classes2.dex growing with the aid of 400KB.
ads
Debugging DEX problems
In this situation, the difference got here from upgrading our dependencies to newer variations and adding new libraries. Proguard and Multidex were already enabled for our builds so there’s now not much that can be done about our DEX size. nonetheless, APK analyzer is a excellent tool to debug any problems with this setup, particularly while you’re allowing Multidex or Proguard for your challenge for the primary time.
ads
while you click on any DEX document, you will see a precis of what number of classes and methods it defines, and how many total references it incorporates (it’s references that rely in opposition to the 64K limit in a unmarried DEX file). In this example screenshot, the app is pretty much to reach the restrict, this means that it will need MultiDex to cut up the lessons into separate files within the close to future.
ads
you could drill down into the programs to see which of them are the use of up all the references. In this example, we will see that the support library and Google Play offerings are the main causes for this situation:
ads
when you’ve enabled MultiDex and compiled your app, you'll notice a 2d classes2.dex file (and possibly classes3.dex, and so forth). The MultiDex answer within the Android gradle plugin figures out which classes are had to start your app and puts them into the primary training.dex record, however in the rare case when it doesn’t paintings and also you get a ClassNotFoundException, you may use APK Analyzer to investigate the DEX files, after which force the lacking instructions to be positioned within the number one DEX file.
ads
you will come across comparable troubles when allowing Proguard and the use of training or techniques by means of mirrored image or from XML layouts. The APK Analyzer permit you to with verifying that your Proguard configuration is correct, with the aid of letting you effortlessly test if the strategies and instructions you require are present within the APK and if they are being renamed (obfuscated). you can additionally make sure that classes you want gone are in reality eliminated, and no longer taking on your precious reference method rely.
ads
We’re curious to hear what other uses you discover for the APK Analyzer and what other functions you’d want to see integrated within the tool!
ads

0 Comments