Quick answer: Strip via Graphics Settings (Lightmap, Fog modes), use IPreprocessShaders for custom keyword stripping, and check Build Report → Shader Compilation count.

A URP game has 30 shader graphs; build report shows 2.5GB of shader variants in the APK. Build is too large for the target. Each keyword multiplies the count.

Built-In Strip Settings

Project Settings → Graphics → Shader Stripping (URP/HDRP have their own settings):

For URP: URP Asset → Quality → toggle features you don’t use (SSAO, Bloom, etc.). Stripping removes their variants.

Custom Keyword Strip

using UnityEditor.Build;
using UnityEditor.Rendering;

class StripCustomKeywords : IPreprocessShaders
{
    public int callbackOrder => 0;

    public void OnProcessShader(Shader shader, ShaderSnippetData snippet, IList<ShaderCompilerData> data)
    {
        for (int i = data.Count - 1; i >= 0; i--)
        {
            if (data[i].shaderKeywordSet.IsEnabled(new ShaderKeyword("USE_OBSCURE_FEATURE")))
                data.RemoveAt(i);
        }
    }
}

Editor-only callback during build. Removes any variant with the named keyword.

Inspect Variant Count

Open shader file in inspector. “Variants Included” section shows count and breakdown. After stripping, recount — should drop dramatically.

Build Report

Window → Analysis → Build Report Inspector (or open Library/LastBuild.buildreport). Sort by size; shader bundles dominate — strip the biggest first.

Don't Ship Unused Shaders

Always Included Shaders in Graphics Settings forces shipping the shader even if no scene uses it. Remove anything not actually used.

Verifying

Rebuild. Build size drops noticeably. Run; visuals unchanged (or only stripped features missing as expected). Build Report variant count down by 5–10×.

“Every keyword is a power-of-two multiplier. Strip aggressively or watch your build size explode.”

For mobile, target <100MB total shader bundle. With stripping disciplines, that’s achievable even for stylized titles.