美文网首页Flutter
Flutter android 打包发布

Flutter android 打包发布

作者: 曲终人散Li | 来源:发表于2018-09-18 16:38 被阅读1296次

    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
    

    相关文章

      网友评论

        本文标题:Flutter android 打包发布

        本文链接:https://www.haomeiwen.com/subject/ttbpnftx.html