Skip to content

Commit

Permalink
Use local adb in portable builds
Browse files Browse the repository at this point in the history
For non-Windows portable builds, use the absolute path to the adb
executable located in the same directory as scrcpy.

On Windows, just use "adb", which is sufficient to use the local one.

PR Genymobile#5560 <Genymobile#5560>
  • Loading branch information
rom1v committed Dec 2, 2024
1 parent beee42f commit 6d0ac36
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/src/adb/adb.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,22 @@ sc_adb_init(void) {
return true;
}

#if !defined(PORTABLE) || defined(_WIN32)
adb_executable = strdup("adb");
if (!adb_executable) {
LOG_OOM();
return false;
}
#else
// For portable builds, use the absolute path to the adb executable
// in the same directory as scrcpy (except on Windows, where "adb"
// is sufficient)
adb_executable = sc_file_get_local_path("adb");
if (!adb_executable) {
// Error already logged
return false;
}
#endif

return true;
}
Expand Down

0 comments on commit 6d0ac36

Please sign in to comment.