(apkFilePath: string)
| 10 | * @param apkFilePath absolute path of the APK file. |
| 11 | */ |
| 12 | export async function installAPK(apkFilePath: string): Promise<void> { |
| 13 | if (!apkFilePath || !fs.existsSync(apkFilePath)) { |
| 14 | vscode.window.showErrorMessage( |
| 15 | `APKLab: APK file not found: ${apkFilePath}`, |
| 16 | ); |
| 17 | return; |
| 18 | } |
| 19 | |
| 20 | if (!apkFilePath.toLowerCase().endsWith(APK_FILE_EXTENSION)) { |
| 21 | vscode.window.showErrorMessage( |
| 22 | `APKLab: File is not an APK: ${apkFilePath}`, |
| 23 | ); |
| 24 | return; |
| 25 | } |
| 26 | |
| 27 | const apkFileName = path.basename(apkFilePath); |
| 28 | const report = `Installing ${apkFileName}`; |
| 29 | const args = ["install", "-r", apkFilePath]; |
| 30 | await executeProcess({ |
| 31 | name: "Installing", |
| 32 | report: report, |
| 33 | command: "adb", |
| 34 | args: args, |
| 35 | }); |
| 36 | } |
| 37 | } |
nothing calls this directly
no test coverage detected