Flutter

Flutter android 打包发布

2018-09-18  本文已影响1296人  曲终人散Li

1.生成key
2.创建key.properties
3.配置app的build.gradle

        def keystorePropertiesFile = rootProject.file("key.properties")
        def keystoreProperties = new Properties()
        keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
signingConfigs {
    release {
        keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties['keyPassword']
        storeFile file(keystoreProperties['storeFile'])
        storePassword keystoreProperties['storePassword']
    }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }
  1. 命令行执行
flutter build apk 
  1. 生成的app-release.apk 就在项目的output/apk/release目录下

  2. 安装 生成的apk包到手机

adb install app-release.apk
上一篇下一篇

猜你喜欢

热点阅读