// TODO(danalbert): Split this file up into adb_main.cpp and adbd_main.cpp. int main(int argc, char **argv) { #if ADB_HOST // adb client/server adb_sysdeps_init(); adb_trace_init(); D("Handling commandline()\n"); return adb_commandline(argc - 1, const_cast<const char**>(argv + 1)); #else // adbd while (true) { static struct option opts[] = { {"root_seclabel", required_argument, nullptr, 's'}, {"device_banner", required_argument, nullptr, 'b'}, {"version", no_argument, nullptr, 'v'}, }; int option_index = 0; int c = getopt_long(argc, argv, "", opts, &option_index); if (c == -1) break; switch (c) { case 's': root_seclabel = optarg; break; case 'b': adb_device_banner = optarg; break; case 'v': printf("Android Debug Bridge Daemon version %d.%d.%d %s\n", ADB_VERSION_MAJOR, ADB_VERSION_MINOR, ADB_SERVER_VERSION, ADB_REVISION); return 0; default: break; } } recovery_mode = (strcmp(adb_device_banner, "recovery") == 0); close_stdin(); adb_trace_init(); /* If adbd runs inside the emulator this will enable adb tracing via * adb-debug qemud service in the emulator. */ adb_qemu_trace_init(); D("Handling main()\n"); return adb_main(0, DEFAULT_ADB_PORT); #endif }
int main(int argc, char** argv) { // Set M_DECAY_TIME so that our allocations aren't immediately purged on free. mallopt(M_DECAY_TIME, 1); android::base::SetMinimumLogSeverity(android::base::WARNING); adb_trace_init(argv); ::benchmark::Initialize(&argc, argv); if (::benchmark::ReportUnrecognizedArguments(argc, argv)) return 1; ::benchmark::RunSpecifiedBenchmarks(); }
int main(int argc, char *argv[]) { #ifndef __WIN32 signal(SIGINT,&signal_handler); signal(SIGABRT, &signal_handler); signal(SIGTERM, &signal_handler); #endif adb_sysdeps_init(); adb_trace_init(); // D("Handling commandline()\n"); return adb_commandline(argc - 1, argv + 1); }
int main(int argc, char **argv) { #if ADB_HOST adb_trace_init(); adb_sysdeps_init(); return adb_commandline(argc - 1, argv + 1); #else if((argc > 1) && (!strcmp(argv[1],"recovery"))) { adb_device_banner = "recovery"; recovery_mode = 1; } start_device_log(); return adb_main(0, DEFAULT_ADB_PORT); #endif }
BOOL CADBTestCEDlg::OnInitDialog() { CDialog::OnInitDialog(); // 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动 // 执行此操作 SetIcon(m_hIcon, TRUE); // 设置大图标 SetIcon(m_hIcon, FALSE); // 设置小图标 setMainDialogPointer(this); // TODO: 在此添加额外的初始化代码 adb_sysdeps_init(); adb_trace_init(); HANDLE serverHandle = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)startServer, NULL, NULL,NULL); m_displayInfo.SetWindowTextW(L"appstart!"); return TRUE; // 除非将焦点设置到控件,否则返回 TRUE }
int main(int argc, char **argv) { if (argc > 1) { D("IN HERE\n"); if (!strcmp(argv[1], "lib")) { adb_main(0, 5037, 1); while (1) { Sleep(10); } } } //debugLog = fopen("/tmp/adb.log.debug", "a+"); //fprintf(debugLog, "-- hit main()"); adb_sysdeps_init(); adb_trace_init(); D("Handling commandline()\n"); printf("Commandline support has been turned off\n"); // return adb_commandline(argc - 1, argv + 1); return 0; }
int main(int argc, char **argv) { #if ADB_HOST adb_sysdeps_init(); #else close_stdin(); #endif adb_trace_init(); #if ADB_HOST D("Handling commandline()\n"); return adb_commandline(argc - 1, const_cast<const char**>(argv + 1)); #else /* If adbd runs inside the emulator this will enable adb tracing via * adb-debug qemud service in the emulator. */ adb_qemu_trace_init(); while (true) { int c; int option_index = 0; static struct option opts[] = { {"root_seclabel", required_argument, 0, 's' }, {"device_banner", required_argument, 0, 'b' } }; c = getopt_long(argc, argv, "", opts, &option_index); if (c == -1) break; switch (c) { case 's': root_seclabel = optarg; break; case 'b': adb_device_banner = optarg; break; default: break; } } D("Handling main()\n"); return adb_main(0, DEFAULT_ADB_PORT); #endif }
int main(int argc, char **argv) { #if ADB_HOST adb_sysdeps_init(); adb_trace_init(); D("Handling commandline()\n"); return adb_commandline(argc - 1, argv + 1); #else /* If adbd runs inside the emulator this will enable adb tracing via * adb-debug qemud service in the emulator. */ adb_qemu_trace_init(); if((argc > 1) && (!strcmp(argv[1],"recovery"))) { adb_device_banner = "recovery"; recovery_mode = 1; } start_device_log(); D("Handling main()\n"); return adb_main(0, DEFAULT_ADB_PORT); #endif }
int main(int argc, char** argv) { while (true) { static struct option opts[] = { {"root_seclabel", required_argument, nullptr, 's'}, {"device_banner", required_argument, nullptr, 'b'}, {"version", no_argument, nullptr, 'v'}, }; int option_index = 0; int c = getopt_long(argc, argv, "", opts, &option_index); if (c == -1) { break; } switch (c) { case 's': root_seclabel = optarg; break; case 'b': adb_device_banner = optarg; break; case 'v': printf("Android Debug Bridge Daemon version %d.%d.%d %s\n", ADB_VERSION_MAJOR, ADB_VERSION_MINOR, ADB_SERVER_VERSION, ADB_REVISION); return 0; default: // getopt already prints "adbd: invalid option -- %c" for us. return 1; } } close_stdin(); debuggerd_init(nullptr); adb_trace_init(argv); D("Handling main()"); return adbd_main(DEFAULT_ADB_PORT); }
int main(int argc, char** argv) { adb_sysdeps_init(); adb_trace_init(argv); return adb_commandline(argc - 1, const_cast<const char**>(argv + 1)); }