ApkHealthChecker 1.0.4

dotnet add package ApkHealthChecker --version 1.0.4
                    
NuGet\Install-Package ApkHealthChecker -Version 1.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ApkHealthChecker" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ApkHealthChecker" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="ApkHealthChecker" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ApkHealthChecker --version 1.0.4
                    
#r "nuget: ApkHealthChecker, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ApkHealthChecker@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ApkHealthChecker&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=ApkHealthChecker&version=1.0.4
                    
Install as a Cake Tool

ApkHealthChecker

Issue Fixed - New Version 1.0.4 ApkHealthChecker is a lightweight .NET library that executes an embedded PowerShell script to analyze and measure the runtime health and performance characteristics of Android applications (APKs). Compatible with Console Application (.NET Framework).

The library is packaged as a NuGet package and supports both modern .NET and legacy .NET Framework environments.


📌 Key Features

  • ✅ Executes an embedded PowerShell (.ps1) script (no external files required)
  • ✅ Simple and reusable C# API
  • ✅ Supports APK performance checks:
    • Cold start analysis
    • Warm start analysis
    • Frame statistics collection
    • Optional reset of performance stats
  • ✅ HTML & JSON Report Generation (Automatic at \bin\Debug\ApkHealthReports\apk_health_report.html)
  • ✅ Multi‑targeted support:
    • .NET 8 (PowerShell 7)
    • .NET Framework 4.7.2 (Windows PowerShell 5.1)

🧱 Architecture Overview

ApkHealthChecker embeds a PowerShell script (Scripts/ApkHealth.ps1) directly into the compiled assembly as an embedded resource.

At runtime, the library:

  1. Loads the embedded PowerShell script
  2. Executes it using System.Management.Automation
  3. Passes parameters from C# to PowerShell
  4. Collects and returns the script output as structured results

This approach:

  • Avoids PowerShell execution‑policy issues
  • Eliminates dependency on external script files
  • Ensures portability and reliability

📦 Installation

Install from NuGet:

dotnet add package ApkHealthChecker

Or via Visual Studio:

  • Right‑click project → Manage NuGet Packages
  • Search for ApkHealthChecker
  • Install

🚀 Usage Example

using ApkHealthChecker;
using System;

namespace ConsoleApp
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var checker = new ApkHealth();

            var results = checker.CheckApk(
                packageName: "com.example.app",
                resetStats: true,
                useFrameStats: true,
                coldStartCount: 2,
                warmStartCount: 3
            );

            foreach (var line in results)
            {
                Console.WriteLine(line);
            }
        }
    }
}```

---

## 🧪 API Reference

### `CheckApk(...)`

```csharp
string[] CheckApk(
    string packageName,
    bool resetStats,
    bool useFrameStats,
    int coldStartCount,
    int warmStartCount
)
Parameters
Parameter Description
packageName Android package name (e.g. com.example.app)
resetStats Whether to reset performance statistics before testing
useFrameStats Whether to collect frame rendering statistics
coldStartCount Number of cold start runs
warmStartCount Number of warm start runs
Returns
  • string[] — Output lines produced by the PowerShell script

⚙️ Requirements

System Requirements

  • Windows OS
  • ADB (Android Debug Bridge) installed and available in PATH
  • ✅ Android device or emulator connected

PowerShell Requirements

Target Framework PowerShell
.NET 8 PowerShell 7+
.NET Framework 4.7.2 Windows PowerShell 5.1

🧩 Target Frameworks

This library is multi‑targeted:

net8.0
net472

NuGet automatically selects the appropriate assembly for your project.


🛠 Development Notes

  • The PowerShell script is embedded using EmbeddedResource
  • No runtime identifier (RID) is required for class library packaging
  • The project is compatible with modern SDK‑style builds
  • Designed to work cleanly with dotnet build and dotnet pack

🧰 Troubleshooting

  • NU5026: File to be packed not found – Clean bin/ and obj/ folders and run a fresh dotnet build before dotnet pack.
  • C# language version issues on net472 – Set <LangVersion>8.0</LangVersion> for net472 and disable implicit usings there.
  • GlobalUsings.g.cs errors on net472 – Disable implicit usings for net472 to avoid C# 10 features in that target.
  • RID warnings on .NET 8 – Prefer portable RIDs (e.g., win-x64) and update dependencies. Use <UseRidGraph>true</UseRidGraph> only as a temporary workaround.

📄 License

MIT License


👤 Author

Mohai Minul Islam
Software Quality Assurance Engineer
Dhaka, Bangladesh

⭐ Why ApkHealthChecker?

ApkHealthChecker bridges the gap between PowerShell‑based Android tooling and modern .NET automation, enabling QA engineers and developers to run repeatable, script‑driven APK performance checks directly from C#.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 147 2/11/2026

ApkHealthChecker v1.0.4 is the first stable release of a .NET library for analyzing Android APK health and performance using an embedded PowerShell script.

This release provides a clean C# API for running cold start, warm start, and frame statistics analysis without requiring external script files. The library supports both .NET 8 (PowerShell 7) and .NET Framework 4.7.2 (Windows PowerShell 5.1), making it suitable for modern and legacy automation environments.

Designed android app performance testing.