Compare commits

..

1 Commits

Author SHA1 Message Date
yangfl
665488298e Show a friendly hint for adb installation
Signed-off-by: Romain Vimont <rom@rom1v.com>
2020-01-18 17:48:42 +01:00
4 changed files with 8 additions and 8 deletions

View File

@@ -57,17 +57,14 @@ argv_to_string(const char *const *argv, char *buf, size_t bufsize) {
static void
show_adb_installation_msg() {
#ifndef __WINDOWS__
static const struct {
const char *binary;
const char *command;
} pkg_managers[] = {
{"apt", "apt install adb"},
{"apt-get", "apt-get install adb"},
{"brew", "brew cask install android-platform-tools"},
{"brew", "brew install android-platform-tools"},
{"dnf", "dnf install android-tools"},
{"emerge", "emerge dev-util/android-tools"},
{"pacman", "pacman -S android-tools"},
};
for (size_t i = 0; i < ARRAY_LEN(pkg_managers); ++i) {
if (cmd_search(pkg_managers[i].binary)) {
@@ -75,7 +72,6 @@ show_adb_installation_msg() {
return;
}
}
#endif
LOGI("You may download and install 'adb' from "
"https://developer.android.com/studio/releases/platform-tools");

View File

@@ -43,10 +43,8 @@ enum process_result {
PROCESS_ERROR_MISSING_BINARY,
};
#ifndef __WINDOWS__
bool
cmd_search(const char *file);
#endif
enum process_result
cmd_execute(const char *const argv[], process_t *process);

View File

@@ -6,6 +6,12 @@
#include "util/log.h"
#include "util/str_util.h"
bool
cmd_search(const char *file) {
// :/
return false;
}
static int
build_cmd(char *cmd, size_t len, const char *const argv[]) {
// Windows command-line parsing is WTF:

View File

@@ -73,7 +73,7 @@ public final class Workarounds {
mInitialApplicationField.set(activityThread, app);
} catch (Throwable throwable) {
// this is a workaround, so failing is not an error
Ln.d("Could not fill app info: " + throwable.getMessage());
Ln.w("Could not fill app info: " + throwable.getMessage());
}
}
}