Use local adb in portable builds
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 #5560 <https://github.com/Genymobile/scrcpy/pull/5560>
This commit is contained in:
parent
beee42fb06
commit
6d0ac3626d
@ -34,11 +34,22 @@ sc_adb_init(void) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(PORTABLE) || defined(_WIN32)
|
||||||
adb_executable = strdup("adb");
|
adb_executable = strdup("adb");
|
||||||
if (!adb_executable) {
|
if (!adb_executable) {
|
||||||
LOG_OOM();
|
LOG_OOM();
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user