Skip to content

Commit 6caa482

Browse files
fix: cli's local adb is not used
In case there's no ANDROI_HOME on user's machine, CLI tries to use its local copy of adb. However, the current path to adb is not correct and CLI does not work with any Android devices in this case. Fix the path to local copy of adb.
1 parent 402666a commit 6caa482

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/config.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ export class StaticConfig implements IStaticConfig {
156156
$hostInfo: IHostInfo = this.$injector.resolve("$hostInfo");
157157

158158
// prepare the directory to host our copy of adb
159-
const defaultAdbDirPath = path.join(__dirname, `resources/platform-tools/android/${process.platform}`);
160-
const pathToPackageJson = path.join(__dirname, "..", "..", "package.json");
161-
const commonLibVersion = require(pathToPackageJson).version;
162-
const tmpDir = path.join(os.tmpdir(), `telerik-common-lib-${commonLibVersion}`);
159+
const defaultAdbDirPath = path.join(__dirname, "common", "resources", "platform-tools", "android", process.platform);
160+
const pathToPackageJson = path.join(__dirname, "..", "package.json");
161+
const nsCliVersion = require(pathToPackageJson).version;
162+
const tmpDir = path.join(os.tmpdir(), `nativescript-cli-${nsCliVersion}`);
163163
$fs.createDirectory(tmpDir);
164164

165165
// copy the adb and associated files

0 commit comments

Comments
 (0)