This is a test repo demonstrating the problem with the Capacitor CLI hard-coding the output APK name in the cap run command. See issue #8040 in the Capacitor repository for more details.
This project is created as follows:
ionic start myApp blank --type=angular-standalone --capacitor --no-git
cd myApp
npm install @capacitor/android
npx cap add androidThen add the following line to ~\android\app\build.gradle:
android {
defaultConfig {
...
archivesBaseName = "$applicationId-v$versionCode"
...Finally, build the project and try to run it:
npx ng build --configuration=development && npx cap copy
npx cap run androidThe last command now fails with the error:
× Deploying app-debug.apk to 28231FDH200GGJ - failed!
[error] Selected hardware device 28231FDH200GGJ
Error: ENOENT: no such file or directory, open 'C:\Dvt\myApp\android\app\build\outputs\apk\debug\app-debug.apk'