@@ -36,8 +36,15 @@ public partial class AdbCommandLineClient : IAdbCommandLineClient
3636 /// <param name="adbPath">The path to the <c>adb.exe</c> executable.</param>
3737 /// <param name="isForce">Doesn't check adb file when <see langword="true"/>.</param>
3838 /// <param name="logger">The logger to use when logging.</param>
39- #if HAS_WINRT && NET
39+ #if NET
40+ #if HAS_WINRT
4041 [ SupportedOSPlatform ( "Windows10.0.10240.0" ) ]
42+ #else
43+ [ SupportedOSPlatform ( "Windows" ) ]
44+ [ SupportedOSPlatform ( "Linux" ) ]
45+ [ SupportedOSPlatform ( "OSX" ) ]
46+ [ SupportedOSPlatform ( "FreeBSD" ) ]
47+ #endif
4148#endif
4249 public AdbCommandLineClient ( string adbPath , bool isForce = false , ILogger < AdbCommandLineClient > ? logger = null )
4350 {
@@ -143,21 +150,24 @@ public virtual bool CheckAdbFileExists(string adbPath) => adbPath == "adb" ||
143150 /// Throws an error if the path does not point to a valid instance of <c>adb.exe</c>.
144151 /// </summary>
145152 /// <param name="adbPath">The path to validate.</param>
153+ #if NET
154+ [ SupportedOSPlatformGuard ( "Windows" ) ]
155+ [ SupportedOSPlatformGuard ( "Linux" ) ]
156+ [ SupportedOSPlatformGuard ( "OSX" ) ]
157+ [ SupportedOSPlatformGuard ( "FreeBSD" ) ]
158+ #endif
146159 protected virtual void EnsureIsValidAdbFile ( string adbPath )
147160 {
148161 if ( adbPath == "adb" ) { return ; }
149162
150- bool isWindows = Extensions . IsWindowsPlatform ( ) ;
151- bool isUnix = Extensions . IsUnixPlatform ( ) ;
152-
153- if ( isWindows )
163+ if ( OperatingSystem . IsWindows ( ) )
154164 {
155165 if ( ! string . Equals ( Path . GetFileName ( adbPath ) , "adb.exe" , StringComparison . OrdinalIgnoreCase ) )
156166 {
157167 throw new ArgumentOutOfRangeException ( nameof ( adbPath ) , $ "{ adbPath } does not seem to be a valid adb.exe executable. The path must end with `adb.exe`") ;
158168 }
159169 }
160- else if ( isUnix )
170+ else if ( OperatingSystem . IsLinux ( ) || OperatingSystem . IsMacOS ( ) || OperatingSystem . IsFreeBSD ( ) )
161171 {
162172 if ( ! string . Equals ( Path . GetFileName ( adbPath ) , "adb" , StringComparison . OrdinalIgnoreCase ) )
163173 {
0 commit comments