Quote apk path on Windows
Windows will parse the string, so the local name must be quoted.
@@ -73,6 +73,16 @@ process_t adb_push(const char *serial, const char *local, const char *remote) {
}
process_t adb_install(const char *serial, const char *local) {
+#ifdef __WINDOWS__
+ // Windows will parse the string, so the local name must be quoted (see sys/win/command.c)
+ size_t len = strlen(local);
+ char quoted[len + 3];
+ memcpy(&quoted[1], local, len);
+ quoted[0] = '"';
+ quoted[len + 1] = '"';
+ quoted[len + 2] = '\0';
+ local = quoted;
+#endif
const char *const adb_cmd[] = {"install", "-r", local};
return adb_execute(serial, adb_cmd, ARRAY_LEN(adb_cmd));
}
