From bf8bd10b7e7712149f464c33bbf12864b0eba691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=80=E9=9D=99=E5=87=A1?= <30424139+wtto00@users.noreply.github.com> Date: Sat, 16 Sep 2023 02:14:12 +0800 Subject: [PATCH] chore: ci --- spec/afterStart.test.ts | 5 ++++- src/index.ts | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/afterStart.test.ts b/spec/afterStart.test.ts index 0a8910d..c21a807 100644 --- a/spec/afterStart.test.ts +++ b/spec/afterStart.test.ts @@ -11,8 +11,11 @@ describe("after start a emulator", () => { if (avds.length === 0) { avdName = `TestCreate_${Math.random()}`; const images = (await android.listImages()).filter((item) => item.vendor === "default"); + console.log("images"); + console.log(images); if (images.length === 0) return; - await android.createAVD({ name: avdName, package: images[images.length - 1].name, force: false }); + const image = images[images.length - 1].name; + await android.createAVD({ name: avdName, package: image, force: false }); } else { avdName = avds[0].Name; } diff --git a/src/index.ts b/src/index.ts index b9a72ae..e0b7b6d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -226,6 +226,9 @@ class Android { * @param name name of AVD */ async createAVD(options: CreateAVDOptions) { + if (options.package) { + await this.sdkmanager(options.package); + } const cmdParams = Object.keys(options).reduce((prev, curr) => { const val = options[curr as keyof CreateAVDOptions]; if (typeof val === "boolean") {