File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
packages/platform-android/src/lib/commands/runAndroid Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1- import { existsSync } from 'node:fs' ;
1+ import { existsSync , readdirSync } from 'node:fs' ;
22import { logger , spawn } from '@rock-js/tools' ;
33import { getAdbPath } from './adb.js' ;
44import type { AndroidProject } from './runAndroid.js' ;
@@ -64,6 +64,16 @@ async function getInstallOutputFileName(
6464 return outputFile ;
6565 }
6666
67+ // check if there is a file like -debug.apk (missing app name)
68+ if ( existsSync ( buildDirectory ) ) {
69+ const pattern = `-${ variant } .${ apkOrAab } ` ;
70+ const files = readdirSync ( buildDirectory ) ;
71+ const matchingFile = files ?. find ( ( file ) => file . endsWith ( pattern ) ) ;
72+ if ( matchingFile ) {
73+ return matchingFile ;
74+ }
75+ }
76+
6777 logger . debug ( 'Could not find the output file:' , {
6878 buildDirectory,
6979 outputFile,
You can’t perform that action at this time.
0 commit comments