Merge "Always include the adb version in the log."
This commit is contained in:
commit
2fb00423d4
3 changed files with 14 additions and 9 deletions
10
adb/adb.cpp
10
adb/adb.cpp
|
|
@ -71,6 +71,14 @@ void AdbLogger(android::base::LogId id, android::base::LogSeverity severity,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string adb_version() {
|
||||||
|
// Don't change the format of this --- it's parsed by ddmlib.
|
||||||
|
return android::base::StringPrintf("Android Debug Bridge version %d.%d.%d\n"
|
||||||
|
"Revision %s\n",
|
||||||
|
ADB_VERSION_MAJOR, ADB_VERSION_MINOR, ADB_SERVER_VERSION,
|
||||||
|
ADB_REVISION);
|
||||||
|
}
|
||||||
|
|
||||||
void fatal(const char *fmt, ...) {
|
void fatal(const char *fmt, ...) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
|
@ -204,6 +212,8 @@ void adb_trace_init(char** argv) {
|
||||||
|
|
||||||
setup_trace_mask();
|
setup_trace_mask();
|
||||||
android::base::InitLogging(argv, AdbLogger);
|
android::base::InitLogging(argv, AdbLogger);
|
||||||
|
|
||||||
|
D("%s", adb_version().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
apacket* get_apacket(void)
|
apacket* get_apacket(void)
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,8 @@ constexpr size_t MAX_PAYLOAD = MAX_PAYLOAD_V2;
|
||||||
#define ADB_VERSION_MAJOR 1
|
#define ADB_VERSION_MAJOR 1
|
||||||
#define ADB_VERSION_MINOR 0
|
#define ADB_VERSION_MINOR 0
|
||||||
|
|
||||||
|
std::string adb_version();
|
||||||
|
|
||||||
// Increment this when we want to force users to start a new adb server.
|
// Increment this when we want to force users to start a new adb server.
|
||||||
#define ADB_SERVER_VERSION 32
|
#define ADB_SERVER_VERSION 32
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,16 +65,9 @@ static std::string product_file(const char *extra) {
|
||||||
gProductOutPath.c_str(), OS_PATH_SEPARATOR_STR, extra);
|
gProductOutPath.c_str(), OS_PATH_SEPARATOR_STR, extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void version(FILE* out) {
|
|
||||||
fprintf(out, "Android Debug Bridge version %d.%d.%d\nRevision %s\n",
|
|
||||||
ADB_VERSION_MAJOR, ADB_VERSION_MINOR, ADB_SERVER_VERSION, ADB_REVISION);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void help() {
|
static void help() {
|
||||||
version(stderr);
|
fprintf(stderr, "%s\n", adb_version().c_str());
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"\n"
|
|
||||||
" -a - directs adb to listen on all interfaces for a connection\n"
|
" -a - directs adb to listen on all interfaces for a connection\n"
|
||||||
" -d - directs command to the only connected USB device\n"
|
" -d - directs command to the only connected USB device\n"
|
||||||
" returns an error if more than one USB device is present.\n"
|
" returns an error if more than one USB device is present.\n"
|
||||||
|
|
@ -1449,7 +1442,7 @@ int adb_commandline(int argc, const char **argv) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (!strcmp(argv[0], "version")) {
|
else if (!strcmp(argv[0], "version")) {
|
||||||
version(stdout);
|
fprintf(stdout, "%s", adb_version().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue