I know in latest version on Android tools we can use if (BuildConfig.DEBUG == true) which I believe it will strip out the code.
Is it possible to strip out activities that are only used for debugging purposes from the production release APK?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From a Java standpoint, ProGuard could probably get rid of them, with the appropriate rules. However, the manifest entries would remain, as would any resources that only those development-mode-only activities would need, etc. At best, this will increase bloat. At worst, if the manifest entries have exported these activities (e.g., via publishing an
<intent-filter>), then your app will crash when something tries to run those activities.