一、概述
? ? ReactNative使用命令打包時,得到的打包文件為:app-release.apk。若想要更改名稱。繼續(xù)往下翻。
二、步驟
1.修改文件XXX/android/app/build.gradle(備注:看不懂,不要方,看看下面圖片)。
android {
????applicationVariants.all {
????????variant.outputs.all {
? ? ? ? ? ? ? ? ? ? .......
????????????????????deffileName= "DSIApp_${buildTime()}.apk"
????????????????????outputFileName=fileName
????????}
????}
}????

修改前的樣子

修改后的樣子
2.定義一個時間變量方法
def buildTime() {
????return new Date().format("yyyyMMddHHmm",TimeZone.getTimeZone("GMT+08:00"))
}

三、參考&遺留問題
參考文章:https://www.cnblogs.com/tangZH/p/10764568.html
遺留問題:時間、精力有限,未來得及研究更改路徑問題,若有哪位朋友弄出來,謝謝你的不吝嗇講解,附在下面。