Custom APK name and output path of gradle configuration tutorial
preface
I've been in contact with Android Stuidio for a while. I had a lot of small problems when I used it before, but the current version feels very easy to use, so I'm ready to completely switch from eclipse to Android Stuidio. During this time, I've transplanted all the public libraries I used often from eclipse. Today, I studied the operations such as packaging and signing under Android studio, In fact, I mainly study gradle. I haven't used gradle before, but I've heard that gradle is a very powerful construction system for a long time. After a day's hard work, I've sorted out and recorded it for your reference and future reference.
demand
The requirement is that when our project goes online, we need to rename the APK file according to the company's explicit rules before it can be released to the market. Therefore, each APK file generated needs to be renamed. It's ok if there are fewer channels, but it's troublesome if there are more channels.
In fact, the method is very simple. Just add the following code to your app's build.gradle file.
What about? Is the above code very simple? Just copy the code into your project and change the response to yours. I believe everyone can understand the code. It's all groovy code. If you don't understand it, you can go to Baidu and have a lot of tutorials.
Add:
Some students may not know where to check the println filename in the above code. You need to check it in the gradle console. I don't know where. Look at the following picture:
If you think the content of the article is helpful to you, please help me. Your support is my greatest encouragement. thank you!!!
@H_ 403_ 33@
summary
The above is the whole content of this article. I hope the content of this article has a certain reference value for your study or work. If you have any questions, you can leave a message. Thank you for your support for programming tips.