Skip to content

Commit 8df5877

Browse files
ser-iocjreynol
authored andcommitted
[skip ci] Merge "Make sure device is connected before bugreport." into main
GitOrigin-RevId: 5270393
1 parent c568f17 commit 8df5877

File tree

1 file changed

+8
-0
lines changed
  • staging/host/commands/host_bugreport

1 file changed

+8
-0
lines changed

staging/host/commands/host_bugreport/main.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ Result<void> CreateDeviceBugreport(
7878
std::string adb_bin_path = HostBinaryPath("adb");
7979
CF_EXPECT(FileExists(adb_bin_path),
8080
"adb binary not found at: " << adb_bin_path);
81+
Command connect_cmd("timeout");
82+
connect_cmd.SetWorkingDirectory(
83+
"/"); // Use a deterministic working directory
84+
connect_cmd.AddParameter("30s")
85+
.AddParameter(adb_bin_path)
86+
.AddParameter("connect")
87+
.AddParameter(ins.adb_ip_and_port());
88+
CF_EXPECT_EQ(connect_cmd.Start().Wait(), 0, "adb connect failed");
8189
Command wait_for_device_cmd("timeout");
8290
wait_for_device_cmd.SetWorkingDirectory(
8391
"/"); // Use a deterministic working directory

0 commit comments

Comments
 (0)