Skip to content

Commit cee7edb

Browse files
authored
feat: use adb from $HOME/Library if no $ANDROID_HOME found
1 parent a5fe657 commit cee7edb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

devices/android.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ func getAdbPath() string {
4545
return adbPath + "/platform-tools/adb"
4646
}
4747

48+
// try default Android SDK location on macOS
49+
homeDir := os.Getenv("HOME")
50+
if homeDir != "" {
51+
defaultPath := filepath.Join(homeDir, "Library", "Android", "sdk", "platform-tools", "adb")
52+
if _, err := os.Stat(defaultPath); err == nil {
53+
return defaultPath
54+
}
55+
}
56+
4857
// best effort, look in path
4958
return "adb"
5059
}

0 commit comments

Comments
 (0)