onnxruntime/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Droid
Yifan Li 25ab935664
[ORT 1.18.1 Release] Cherry pick 2nd round (#21111)
### Description
<!-- Describe your changes. -->
[#21062](https://github.com/microsoft/onnxruntime/pull/21062),
[#21096](https://github.com/microsoft/onnxruntime/pull/21096) to fix
Xamarin,

[#21095](https://github.com/microsoft/onnxruntime/pull/21095) and
[#21109](https://github.com/microsoft/onnxruntime/pull/21109) to fix
python on NuGet_Packaging stages

[#21104](https://github.com/microsoft/onnxruntime/pull/21104) to remove
failing roslynanalyzer on NuGet_Packaging stages

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

---------

Co-authored-by: Scott McKay <skottmckay@gmail.com>
Co-authored-by: Yi Zhang <zhanyi@microsoft.com>
Co-authored-by: Changming Sun <chasun@microsoft.com>
2024-06-20 17:01:57 -07:00
..
Assets
Properties [ORT 1.18.1 Release] Cherry pick 2nd round (#21111) 2024-06-20 17:01:57 -07:00
Resources [ORT 1.18.1 Release] Cherry pick 2nd round (#21111) 2024-06-20 17:01:57 -07:00
InferenceTest.android.cs
MainActivity.cs
Microsoft.ML.OnnxRuntime.Tests.Droid.csproj [ORT 1.18.1 Release] Cherry pick 2nd round (#21111) 2024-06-20 17:01:57 -07:00
ReadMe.md [ORT 1.18.1 Release] Cherry pick 2nd round (#21111) 2024-06-20 17:01:57 -07:00

To test you need the libonnxruntime.so for the various Android architectures.

The test project looks for these in '......\build\Android<architecture>\Release\libonnxruntime.so'. e.g. '......\build\Android\arm64-v8a\Release\libonnxruntime.so'

'......' is the root directory of the repository.

Build onnxruntime for the required architecture if you're testing changes in the native code.

Alternatively, if you're testing the C# code you can extract the AAR from the nightly nuget Microsoft.ML.OnnxRuntime package.

  • Get the nupkg from https://aiinfra.visualstudio.com/PublicPackages/_artifacts/feed/ORT-Nightly
  • Unzip it, and the AAR is in runtimes/android/native/onnxruntime.aar.
  • Unzip the AAR. The jni directory contains a directory for each architecture with the libonnxruntime.so.
  • Copy the libonnxruntime.so for the required architectures to /build/Android//Release.
    • e.g. x86_64 for running the emulator on an amd64 machine, and arm64-v8a for running on an arm64 Android device