Announcing to the WinRT package of AdvancedSharpAdbClient

Announcing

We have packaged this project into winrt. With the winrt version, we can use it in cpp/winrt and other projects. You can find the winrt version in winrt branch.

How to use it

There are two way to reference it.

  • Reference to the project directly

    Fork this repository and change the branch to winrt.

    • If your project is face to uwp, add this to your .vcproj

      1
      2
      3
      4
      <ProjectReference Include="\path\to\AdvancedSharpAdbClient.WinRT.csproj">
      <Project>{083cdc04-9cc2-46e4-84c2-55b645be9d50}</Project>
      <SetTargetFramework>TargetFramework=uap10.0</SetTargetFramework>
      </ProjectReference>
    • If your project is face to desktop, add this to your .vcproj

      1
      2
      3
      4
      <ProjectReference Include="\path\to\AdvancedSharpAdbClient.WinRT.csproj">
      <Project>{083cdc04-9cc2-46e4-84c2-55b645be9d50}</Project>
      <SetTargetFramework>TargetFramework=net6.0-windows10.0.17763.0</SetTargetFramework>
      </ProjectReference>
  • Reference to the nuget package

    Download AdvancedSharpAdbClient.WinRT.zip.

    Unzip it into nupkgs folder of the root path of your project
    image

    Create nuget.config into the root path of your project and add

    1
    2
    3
    4
    5
    6
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <packageSources>
    <add key="Offline Nugets" value="nupkgs" />
    </packageSources>
    </configuration>

    Open the manager of nuget and you will find it. Just install it like a normal nuget.
    image

After that, if your project is not packaged into appx or misx, remember to create ProjectName.exe.manifest in the root of your project to register winrt class.

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
63
64
65
66
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="ProjectName"/>
<file name="WinRT.Host.dll">
<activatableClass
name="AdvancedSharpAdbClient.WinRT.AdbClient"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.AdbCommandLineClient"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.AdbServer"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.AdbServerFeatures"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.AdbSocket"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.CrossPlatformFunc"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.DateTimeHelper"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.DeviceMonitor"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.Factories"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.SyncCommandConverter"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.SyncService"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.TcpSocket"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.DeviceCommands.LinuxPath"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.DeviceCommands.PackageManager"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AdvancedSharpAdbClient.WinRT.Logs.LogReader"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
</file>
</assembly>

Announcing to the WinRT package of AdvancedSharpAdbClient 作者 @wherewhere 2023年7月19日 发表于 GitHub,转载请注明出处