D
D
Delakey Blackhole2016-08-29 18:12:20
Android
Delakey Blackhole, 2016-08-29 18:12:20

Visual Studio build apk how to set output package name?

Visual Studio build apk how to set output package name?
now when I build, I get a file called android-debug.apk, which is generated in the
{project_dir}\bin\Android\Debug directory
in the project settings, I don't see how you can set the name of the output file, and I also can't find the event (Run after assembly) which is executed at the end of the build

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Perelygin, 2016-08-30
@orcDamnar

in the project's build.gradle, for example define a function

def moveBuild(){
    Path original = Path.getDefault().getPath(new File(projectDir, 'путь/имя_вашего_апк.apk' );
    Path dest = Path.getDefault().getPath(куда желаете сохранить)
    Files.copy(original, dest, StandardCopyOption.REPLACE_EXISTING);
}

и вызвать ее, в тот момент, когда вам необходимо скопировать эти апк:
gradle.taskGraph.afterTask { task ->

    if (task.name == 'assembleRelease(ну или то, что вы там собираете - зависит от конфигурации)') {
        if(!project.gradle.startParameter.taskNames.contains('clean')(если не добавить эту проверку, то при cleanProject всегда будет крешить)) {
            moveBuild();
        }
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question