-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathAdbDeviceInfo.cs
More file actions
62 lines (51 loc) · 1.79 KB
/
AdbDeviceInfo.cs
File metadata and controls
62 lines (51 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Xamarin.Android.Tools;
/// <summary>
/// Represents an Android device or emulator from 'adb devices -l' output.
/// Mirrors the metadata produced by dotnet/android's GetAvailableAndroidDevices task.
/// </summary>
public class AdbDeviceInfo
{
/// <summary>
/// Serial number of the device (e.g., "emulator-5554", "0A041FDD400327").
/// For non-running emulators, this is the AVD name.
/// </summary>
public string Serial { get; set; } = string.Empty;
/// <summary>
/// Human-friendly description of the device (e.g., "Pixel 7 API 35", "Pixel 6 Pro").
/// </summary>
public string Description { get; set; } = string.Empty;
/// <summary>
/// Device type: Device or Emulator.
/// </summary>
public AdbDeviceType Type { get; set; }
/// <summary>
/// Device status: Online, Offline, Unauthorized, NoPermissions, NotRunning, Unknown.
/// </summary>
public AdbDeviceStatus Status { get; set; }
/// <summary>
/// AVD name for emulators (e.g., "pixel_7_api_35"). Null for physical devices.
/// </summary>
public string? AvdName { get; set; }
/// <summary>
/// Device model from adb properties (e.g., "Pixel_6_Pro").
/// </summary>
public string? Model { get; set; }
/// <summary>
/// Product name from adb properties (e.g., "raven").
/// </summary>
public string? Product { get; set; }
/// <summary>
/// Device code name from adb properties (e.g., "raven").
/// </summary>
public string? Device { get; set; }
/// <summary>
/// Transport ID from adb properties.
/// </summary>
public string? TransportId { get; set; }
/// <summary>
/// Whether this device is an emulator.
/// </summary>
public bool IsEmulator => Type == AdbDeviceType.Emulator;
}