title: How to build android bundle for app using Gradle script?
body: <p>I want to upgrade my release gradle script to make android bundle instead android apk package, but I can't find the command to create bundle programmatically from gradle script instead apk.</p>
  
  <p>This is what I have to convert. What is the particular command that create the apk? And what is the specified command to use to create bundle? I can't find.</p>
  
  <pre><code>            // copy apk file
              variant.outputs.each { output -&gt;
                  if (output.outputFile != null) {
                      println "outputFile name ${output.outputFile.name}"
  
                      variant.assemble.doLast {
                          copy {
                              from output.outputFile
                              into destination
                              rename { String fileName -&gt;
                                  "app-${variant.productFlavors[0].name}-${buildType.name}-${versName}.apk"
                              }
                          }
                      }
                  }
              }
          }
      }
  </code></pre>
  
  <p>I thought that was the </p>