Version 1.0.0. A short overview is in the README.md file and the release history is in the CHANGELOG.md file, both in the root folder of the package.
Overview
An Android build declares far more than the manifest in your project. The manifest merger combines the manifest Unity generates, your custom manifests, every .androidlib folder, every .aar file and every Maven artifact in the build into one AndroidManifest.xml, and Gradle leaves two reports that say where each line came from. Android Manifest Inspector reads that merged manifest and those reports after a build and shows them inside the Unity Editor.
For each permission, feature, query, component (activity, service, receiver, provider), meta-data entry, application attribute and SDK level of the merged manifest you get:
- the source that declared it: Unity, a custom manifest of yours, an
.androidlib, an.aarfile, a Maven artifact or the build system itself - the merge trail: the files the declaration passed through, with module, file and line
- badges for runtime permissions, permissions that Google Play restricts, exported components without a protecting permission, entries that only the manifest merger added, and insecure application settings
- what changed since the previous build of the same variant
On top of that the package can:
- check the manifest against a rules asset in the window, in batch mode and at build time, and fail the build when a rule is broken
- export the report as Markdown, JSON or CSV
- produce the
tools:node="remove"line that drops an entry, show the resulting custom main manifest and write it, only when you click Write - be called from your own Editor code through a small public API
What it does not do:
- It does not start a build, run Gradle, download anything or change a build setting. It reads build output that already exists.
- It does not edit
AndroidManifest.xmlexcept when you click Write in the preview dialog. - It does not resolve Gradle dependency conflicts or build errors.
- It does not read iOS
Info.plistfiles or privacy manifests. - It does not read builds made on another machine, except an exported Gradle project or a snapshot you open yourself.
- It does not give Google Play policy advice. It flags the permissions on a list (see Badges); whether your app may use them is for you and Google to decide.
- It does not name the script or assembly that calls a Unity API, and it does not name the plugin whose Gradle dependency pulled in a Maven artifact. A Maven artifact is named by its coordinates.
It is an Editor tool. The package has no runtime assembly, adds nothing to a player build and uses no third-party code.
Requirements
- Unity 6000.0.84f1 or newer; that is the minimum the package declares, because it is the lowest Unity 6000.0 patch whose build output was read while developing this package. What was run on which version is listed in Tested on.
- The Android Build Support module of the Unity Editor and an Android build made through Gradle. Unity 6000 builds Android through Gradle.
- Windows is the only Editor operating system that was run. macOS and Linux Editors were not run (see Tested on).
- No other package is needed. The package depends only on Unity's built-in modules IMGUI, JSON Serialize and UI Toolkit.
Installation
From the Asset Store
- Open the Package Manager: Window > Package Manager in Unity 6.0, Window > Package Management > Package Manager in Unity 6.3.
- Select My Assets and find Android Manifest Inspector.
- Click Download, then Install (or Import).
Unity installs the tool as a package. It appears under Packages > Android Manifest Inspector in the Project window and its files are read-only.
Demo sample
In the Package Manager, select Android Manifest Inspector, open the Samples tab and import Demo. Unity copies it into your project under Assets/Samples.
| File | What it is |
|---|---|
README.txt |
The first run in five steps. |
Editor/ManifestGateExample.cs |
A short Editor script that uses only the public API. It adds two menu items under Tools > luanrobs > Android Manifest Inspector > Samples: Open Example Report and Check Newest Build With Example Rules. It lives in its own Editor-only assembly, Luanrobs.ManifestInspector.Demo. |
Rules/Example Manifest Rules.asset |
A rules asset that forbids RECORD_AUDIO, READ_PHONE_STATE and QUERY_ALL_PACKAGES and expects INTERNET. |
Reports/Example Report.json |
A report saved from an Android build of a small test project, to try the window without making a build. |
Manifests/ExampleCustomMainManifest.xml |
A custom main manifest with two remove markers. Unity does not read it from this folder; copy it to Assets/Plugins/Android/AndroidManifest.xml to try it. |
Things to know about the sample:
- It has no scenes and adds nothing to a build. Every file is Editor only.
- The example custom main manifest contains the activity block for
UnityPlayerGameActivity. If your project uses another activity, start from the template Unity gives you for your project instead.
Quick start
- Build your project for Android (File > Build Profiles, Android, Build). The package reads builds made through Gradle, which is how Unity 6000 builds Android.
- Open the window with Tools > luanrobs > Android Manifest Inspector > Open Inspector. It shows the build that just finished. Inspect After Build is on by default, so the window refreshes by itself after every Android build.
- Search or filter the list, select an entry and read where it comes from in the details pane.
- Optional: create a rules asset with Assets > Create > luanrobs > Android Manifest Inspector > Manifest Rules, list the permissions you do not want, pick the asset under Settings > Active Rules in the window, and turn on Fail Build On Violation to make a build fail when it breaks a rule.
Without a build, import the Demo sample and choose Tools > luanrobs > Android Manifest Inspector > Samples > Open Example Report.
From code, the smallest use is:
using Luanrobs.ManifestInspector;
using UnityEditor;
using UnityEngine;
public static class ListPermissions
{
[MenuItem("Tools/My Project/List Permissions")]
public static void Run()
{
ManifestReport report = AndroidManifestInspector.InspectLatestBuild();
if (report == null)
{
Debug.Log("There is no Android build output in this project yet.");
return;
}
foreach (ManifestEntry entry in report.GetEntries(ManifestEntryGroup.Permissions))
{
Debug.Log(entry.Name + " is declared by " + entry.Source.DisplayName);
}
}
}
The window
Open it with Tools > luanrobs > Android Manifest Inspector > Open Inspector. The window is built with UI Toolkit, uses the Editor's own controls and colours and follows the light and dark skin. Its minimum size is 720 x 420.
| Part | What it has |
|---|---|
| Header | The package icon, the name and the version. |
| Toolbar | Source menu, Refresh, the tabs Entries, Changes and Rules, the Export menu and the Settings menu. On the Entries tab also: a search field, the badge toggles Runtime, Play-sensitive, Exported, Implied and Insecure, a Source Kind menu and the Changed Only toggle. |
| Summary | The package name, version, variant, scripting backend, build time (UTC), SDK levels and the source on screen. |
| Notices | Warnings and errors about the report, as warning and error boxes. |
| Footer | The name and version, a Manual link that opens the online manual only when you click it, and the support e-mail address. |
Source chooses what the window shows:
- Newest Build is the build of this project described in Reading a build.
- One item per build found under
Library/Bee/Android/Prj, labelled with the scripting backend, the variant and the build time. A development build and a release build of the same project are separate items. - Open Gradle Project... reads an exported Gradle project that was built, for example in Android Studio.
- Open Snapshot... opens a snapshot file or a report saved with the Export > JSON... command.
Refresh reads the current source again and saves a snapshot of a build (see Changes and snapshots).
With no build in the project the window shows: "No Android build output was found for this project. Build for Android, or open an exported Gradle project or a snapshot from the Source menu."
The window remembers its source, the tab and the selected entry across domain reloads, and the splitter position and last folders per user. Nothing is logged when it works.
Reading a build
After a Gradle build Unity leaves a Gradle project under Library/Bee/Android/Prj/<backend>/Gradle, where <backend> is IL2CPP or Mono2x. In the application module (launcher) the package reads three files:
- the merged manifest,
launcher/build/intermediates/merged_manifest/<variant>/process<Variant>MainManifest/AndroidManifest.xml - the manifest merger blame report,
launcher/build/intermediates/manifest_merge_blame_file/<variant>/process<Variant>MainManifest/manifest-merger-blame-<variant>-report.txt - the manifest merger log,
launcher/build/outputs/logs/manifest-merger-<variant>-report.txt
<variant> is release for a normal build and debug for a development build. If a file is not at that place, the package tries a few alternative locations under the same module.
Observed while developing the package: Unity 6000.3.12f1 generated a Gradle project with Android Gradle Plugin 8.10.0 and Gradle 8.13, and Unity 6000.0.84f1 one with Android Gradle Plugin 9.0.0 and Gradle 9.3.1. Both put the files above in the same places, and the text formats of the blame report and the merger log were the same. Other Unity patches and other Gradle versions were not inspected.
What the entries are:
| Group | Entries |
|---|---|
| Permissions | uses-permission, uses-permission-sdk-23 and permission declarations. |
| Features | uses-feature, including the OpenGL ES version as glEsVersion. |
| Queries | The children of queries: packages, intents and providers. |
| Components | activity, activity-alias, service, receiver and provider. |
| Meta-data | meta-data directly under application. |
| Application | Each attribute of the application element, such as android:label or android:debuggable. |
| SDK | minSdkVersion, targetSdkVersion, maxSdkVersion of uses-sdk, and compileSdk read from the build.gradle of the application module. |
| Other | Any other child of manifest or application. |
Every entry has a key, for example uses-permission#android.permission.INTERNET, service#com.example.MyService or application@android:label. When a key occurs twice in the manifest, the later ones get ~2, ~3 and so on. Inside a group the list is sorted by kind and name, the same way every time; the report of the same build files is the same on every run.
The newest build:
- Gradle does not rewrite the merged manifest of a build that changed nothing. The build time of a report is the write time of the merged manifest, so it is the time of the last build that changed the manifest, not always the time of the latest build. This is observed behaviour: a second build with nothing changed ran Gradle, but the merged manifest and both reports kept their write times.
- After each inspected build the post-build step records which build it read in
Library/Luanrobs.ManifestInspector/LastBuild.txt. Newest Build,AndroidManifestInspector.InspectLatestBuild()and batch mode without-manifestGradleProjectuse the recorded build, unless the merged manifest of another build was written after the record. - Without that record (inspection after builds turned off, or no build made with the package installed) the newest build is the one whose merged manifest changed last. On a build machine that builds several variants or backends, pass
-manifestVariantand-manifestBackendto batch mode (see Batch mode).
Both a release and a development build can exist side by side under the same backend folder, each with its own merged manifest and reports. A module folder of an .androidlib that you removed from the project stays under Gradle/unityLibrary after the next build; the package follows what the reports name, not the leftover folder.
Where an entry comes from
The blame report maps every line of the merged manifest to the file and line it came from. The package uses it like this:
- It checks that the blame report is usable: for every line of the merged manifest the report has the same text. If not, it reads the merger log instead and adds a warning.
- It looks up the line of the entry. In the application module's report that line usually points at the merged manifest of
:unityLibrary, a module's own merged manifest rather than the real origin. - It follows that line into the report of that module, and on, at most eight hops, until it reaches a file that is not a merged manifest. Each location it visits becomes one step of the merge trail.
- It classifies the last location (the table below).
- It appends the records of the manifest merger log for the same entry, which show who else declares it.
For an entry the blame report does not cover, the package uses the merger log; if neither says anything about it, the source is Unknown. It never guesses.
Source kinds
| Source kind | Display name | What it means |
|---|---|---|
| Unity | Unity |
The declaration is in the manifest Unity generated for the build (unityLibrary/src/main/AndroidManifest.xml or the launcher manifest). The tool does not claim to know which script or setting caused it; where Unity documents or the builds showed a cause, the details pane says so (see the next table). |
| Custom manifest | Custom main manifest or Custom launcher manifest |
The declaration is also in your own Assets/Plugins/Android/AndroidManifest.xml or Assets/Plugins/Android/LauncherManifest.xml. The details pane shows the asset path. |
| Android library | The name of the .androidlib folder |
The declaration is in the manifest of an .androidlib folder in your project or in a package. The details pane shows the asset path and, for a package, the package name. |
| AAR file | <Name>.aar |
The declaration is in the manifest inside a local .aar file. |
| Maven artifact | The coordinates of the artifact, such as group:name:version |
The declaration is in the manifest of a Gradle dependency. The tool names the artifact, not the plugin that asked for it. |
| Gradle module | The Gradle path of the module | The declaration is in the manifest of another Gradle module of the project. |
| Build system | Gradle build or Manifest merger |
Not declared by any manifest file. Gradle build: injected by the Android Gradle Plugin from the build configuration (SDK levels, android:extractNativeLibs, android:debuggable in a development build). Manifest merger: added by the merger itself, for example an implied permission. |
| Unknown | Unknown |
The reports say nothing about this entry. |
A Unity source covers a manifest line Unity writes. If your project also declares the same entry in a custom manifest, the source is the custom manifest, because that is the file you can change.
What Unity adds, and why
For permissions that come from Unity the explanation reads "Unity adds this when ...". The table below is complete: no other entry has a specific explanation, and every other entry from Unity gets the general text: "Declared in the manifest Unity generates for the build. Unity writes it from Player Settings and from the Unity APIs that scripts and plugins use; a build callback of a plugin can also write there."
| Permission | Unity adds this when | Evidence |
|---|---|---|
android.permission.INTERNET |
a script or plugin uses a networking API such as UnityWebRequest, or Player Settings > Other Settings > Internet Access is set to Require | Documented in Unity's Android Player Settings; not re-read while developing this package |
android.permission.ACCESS_NETWORK_STATE |
a script or plugin reads Application.internetReachability | Documented in the Unity manual page Android permissions in Unity, read on 2026-10-08 |
android.permission.VIBRATE |
a script or plugin calls Handheld.Vibrate | Documented, same page |
android.permission.ACCESS_FINE_LOCATION |
a script or plugin uses a location API such as LocationService (Input.location) | Documented, same page |
android.permission.CAMERA |
a script or plugin uses the WebCamTexture class | Documented, same page |
android.permission.RECORD_AUDIO |
a script or plugin uses the Microphone class | Documented, same page |
android.permission.WRITE_EXTERNAL_STORAGE |
Player Settings > Other Settings > Write Permission is set to External (SDCard) | Observed: builds with that setting on had it from Unity, builds without it did not |
Observed in a development build with all the triggers above on, Unity also wrote MODIFY_AUDIO_SETTINGS, BLUETOOTH, ACCESS_COARSE_LOCATION and the features android.hardware.location.gps, location, camera, camera.autofocus, camera.front and microphone (all required="false"). Because all triggers were in one build, the package does not claim which call or setting added which of those, and it gives them the general text. The plain build had none of them.
Other things to know about sources
android:debuggablein a development build has no blame line and no log record; the package attributes it toGradle buildwith the text "Set by the Android Gradle Plugin for a debug build (a Development Build in Unity)."uses-sdkvalues come fromGradle buildtoo: "Set by the Gradle build configuration. Unity writes it from Player Settings > Other Settings (Minimum and Target API Level)." andcompileSdkis "Read from compileSdk in the build.gradle of the application module."- An
IMPLIEDrecord in the merger log is shown as sourceManifest mergerwith the merger's reason. Observed in builds with Force SD card permission on: the merger addedREAD_EXTERNAL_STORAGEbecauseWRITE_EXTERNAL_STORAGEwas requested. - Packages: for an
.androidlibor.aarthat lives in an embedded package or inLibrary/PackageCache, the asset path is shown asPackages/<id>/...and the package name is the second segment. - Paths in entries, exports and snapshots never contain the folder of the machine that made the build: the Gradle project becomes
<gradle>/..., Gradle's cache<gradle-cache>/...and your project folder is cut to project-relative paths. The Source line of the window shows the folder or file you opened. - The custom manifests are read as they are when the build is read. The window warns when
Assets/Plugins/Android/AndroidManifest.xmlorLauncherManifest.xmlis newer than the build.
Badges
A badge is a flag with a one-sentence note. The notes are shown in the details pane and in exports.
| Badge | Applies when | Note |
|---|---|---|
| Runtime | A uses-permission or uses-permission-sdk-23 entry whose name is in the list of runtime permissions below |
Runtime permission: Android asks the user to grant it while the app runs. |
| Play-sensitive | A permission on the Google Play list below | The sentence of the list below. |
| Exported | A component with android:exported="true" and no android:permission (for a provider also no android:readPermission and no android:writePermission), that is not a launcher activity |
Exported and not protected by a permission: other apps on the device can reach this component. |
| Implied | Any step of the entry's merge trail is an implied record | Not declared by any manifest: the manifest merger added it; the merge trail gives its reason. |
| Insecure | android:debuggable or android:usesCleartextTraffic is true on the application |
The app is debuggable. Expected in a development build only. / The app allows unencrypted HTTP traffic. |
A launcher activity is an activity or activity alias with an intent filter that has the action android.intent.action.MAIN and the category android.intent.category.LAUNCHER or android.intent.category.LEANBACK_LAUNCHER.
The runtime permissions known to this version, all prefixed android.permission.: READ_CALENDAR, WRITE_CALENDAR, CAMERA, READ_CONTACTS, WRITE_CONTACTS, GET_ACCOUNTS, ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION, ACCESS_BACKGROUND_LOCATION, ACCESS_MEDIA_LOCATION, RECORD_AUDIO, READ_PHONE_STATE, READ_PHONE_NUMBERS, CALL_PHONE, ANSWER_PHONE_CALLS, READ_CALL_LOG, WRITE_CALL_LOG, ADD_VOICEMAIL, USE_SIP, PROCESS_OUTGOING_CALLS, ACCEPT_HANDOVER, BODY_SENSORS, BODY_SENSORS_BACKGROUND, ACTIVITY_RECOGNITION, SEND_SMS, RECEIVE_SMS, READ_SMS, RECEIVE_WAP_PUSH, RECEIVE_MMS, READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE, READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO, READ_MEDIA_VISUAL_USER_SELECTED, BLUETOOTH_SCAN, BLUETOOTH_ADVERTISE, BLUETOOTH_CONNECT, UWB_RANGING, NEARBY_WIFI_DEVICES, POST_NOTIFICATIONS. The list is fixed in this version; a runtime permission that Android adds later is not flagged.
The Play-sensitive list follows the Google Play policy page Permissions and APIs that Access Sensitive Information, as read on 2026-10-08. It is a flag, not policy advice: the page changes, and this version does not update itself. Check the current page before you decide anything.
Permissions (prefix android.permission.) |
Note |
|---|---|
READ_SMS, SEND_SMS, WRITE_SMS, RECEIVE_SMS, RECEIVE_WAP_PUSH, RECEIVE_MMS |
Google Play restricts SMS permissions to default SMS or assistant handlers and asks for a declaration. |
READ_CALL_LOG, WRITE_CALL_LOG, PROCESS_OUTGOING_CALLS |
Google Play restricts Call Log permissions to default phone or assistant handlers and asks for a declaration. |
ACCESS_BACKGROUND_LOCATION |
Google Play asks for a declaration and a review before an app uses location in the background. |
MANAGE_EXTERNAL_STORAGE |
Google Play allows All files access only for apps that need broad file access and reviews its use. |
QUERY_ALL_PACKAGES |
Google Play allows broad package visibility only when the core purpose of the app needs it and asks for a declaration. |
REQUEST_INSTALL_PACKAGES |
Google Play allows this permission only for listed uses such as file sharing or backup and asks for a declaration. |
READ_MEDIA_IMAGES, READ_MEDIA_VIDEO |
Google Play asks for a declaration for photo and video permissions and expects the system photo picker otherwise. |
USE_EXACT_ALARM |
Google Play allows this permission only for alarm, timer and calendar apps and asks for a declaration. |
USE_FULL_SCREEN_INTENT |
Google Play pre-grants full-screen intents only to alarm and calling apps; other apps need the user's consent. |
BODY_SENSORS, BODY_SENSORS_BACKGROUND |
Google Play reviews body sensor permissions under its Health apps policy. |
com.google.android.gms.permission.AD_ID |
The advertising ID permission, usually added by ad and analytics SDKs. Play Console has an advertising ID declaration that has to agree with it. |
The AD_ID row is not on that policy page, and its sentence was not checked against a Google page.
The details pane and the merge trail
Select a row in the Entries list to fill the details pane:
- Key, Value and the line of the merged manifest.
- Badges, each with its note.
- Source: the kind, the display name, the asset path with a Select button that highlights the asset in the Project window, the package name, the Maven coordinates, the manifest path and line, and the explanation.
- Raw XML: the element in a canonical form (two-space indentation, one line per element, comments dropped). You can select and copy it.
- Merge Trail: one line per step.
- How to Remove: see How to remove an entry.
A step of the merge trail has an action, the module whose report named it, a label, a path with a line and, when the record has one, a reason.
| Action | Meaning |
|---|---|
| Added | The declaration was added from this location. |
| Merged | The declaration passed through this location, which is the merged manifest of a module; the next step is where it came from. |
| Injected | The Android Gradle Plugin injected it from the build configuration. |
| Rejected | The merger discarded this declaration. In the build where a remove marker dropped a permission an .androidlib declared, the log showed the .androidlib as rejected. |
| Implied | The merger added it because of another entry; the step has the merger's reason. |
| Converted | The merger log recorded a conversion. |
The first steps follow the entry to its origin. The steps after them come from the application module's merger log and show who else declares the same entry.
A row in the list also shows a marker for a rule violation and for an entry that was added or changed since the previous build.
Changes and snapshots
A snapshot is a JSON file with a whole report. The window compares a build with the snapshot saved for the build before it.
- The post-build step saves a snapshot after every inspected Android build.
- Refresh and a choice in the Source menu save a snapshot of the build on screen, but only when no snapshot of that build exists yet: a snapshot made by the post-build step is never replaced by a later reading. Opening a snapshot only compares.
- Reopening the window or a domain reload does not save a snapshot.
- Snapshots are kept in
Library/Luanrobs.ManifestInspector/Snapshotsby default (Settings > Snapshot Folder... changes it). A snapshot is namedyyyyMMdd-HHmmss-<variant>.jsonwith the build time in UTC. - At most 20 snapshots are kept per variant (
MaxSnapshots, from 1 to 500). A run of development builds never deletes release snapshots. - The previous build is the newest snapshot with the same package name and the same variant and a build time strictly earlier than the current one, compared as whole seconds. An unchanged rebuild keeps the build time of the last build that changed the manifest, so it is not a new build for the Changes view.
The Changes tab shows "N added, N removed, N changed since yyyy-MM-dd HH:mm:ss UTC", or "No previous build to compare with.", or "No changes since ... UTC.", and the list. Clicking a change that is still in the build selects the entry in the Entries tab. Changed Only on the Entries tab limits the list to added and changed entries.
Entries are matched by key. An entry is changed when its XML differs or its source differs in kind, display name, asset path or coordinates. File paths, line numbers, merge trails, badges and notes are not compared. For a changed entry the list shows one line per difference:
<attribute>: <before> -> <after>for each own attribute whose value differs (a missing side is(none))value: <before> -> <after>for an SDK levelsource: <before> -> <after>when the source differscontent: changedwhen the XML differs and no line above explains it
Snapshots hold no absolute path of the machine that made the build, so they can be committed or shared. The Library folder is usually not part of version control; a snapshot folder under Library is lost with it, and the next build then has nothing to compare with. Point Snapshot Folder at a folder you keep if you want the history.
Snapshot files have this form; JsonUtility writes them with four-space indentation and \n line ends:
{
"formatVersion": 1,
"inspectorVersion": "1.0.0",
"unityVersion": "6000.3.12f1",
"packageName": "com.example.game",
"versionName": "1.0",
"versionCode": "1",
"minSdkVersion": 25,
"targetSdkVersion": 36,
"compileSdkVersion": 36,
"variant": "release",
"scriptingBackend": "IL2CPP",
"buildTimeUtc": "2026-10-03T15:59:58Z",
"hasMergerReport": true,
"warnings": [],
"entries": [ ... ]
}
Each entry has key, kind, tag, name, value, line, xml, attributes, intentFilters, badges, notes, source (with kind, displayName, assetPath, packageName, coordinates, manifestPath, line and explanation) and trail (steps with action, attribute, module, label, path, line, column and reason). Enums are written as their C# names. A file that is not an Android Manifest Inspector snapshot, or has no formatVersion, is refused with "The file is not an Android Manifest Inspector snapshot."; a formatVersion newer than 1 with "The snapshot was written by a newer version of Android Manifest Inspector."
How to remove an entry
The How to Remove section of the details pane shows the manifest merger marker that drops the selected entry and where to put it. The helper works on your custom main manifest, Assets/Plugins/Android/AndroidManifest.xml (Player Settings > Publishing Settings > Custom Main Manifest).
For a permission, permission declaration, named feature, component or application-level meta-data entry the snippet is a line such as:
<uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove" />
For an application attribute it is tools:remove="android:NAME" on the <application> element. Attribute snippets can only be copied, not inserted.
The manifest element needs xmlns:tools="http://schemas.android.com/tools"; the preview adds the declaration when it is missing.
Buttons:
- Copy Snippet copies the line to the clipboard.
- Preview and Write... is enabled when the snippet can be inserted and
Assets/Plugins/Android/AndroidManifest.xmlexists. It opens a dialog with the resulting file, the lines that change, Write and Cancel.
Nothing is written until you click Write. The package reads the file as bytes, keeps every character of the file except what it adds (the xmlns:tools attribute right after <manifest when it is missing, and the snippet line before the closing tag of the parent, indented like the other children, using the line end the file uses most), and checks that the result is well-formed XML. A self-closing or missing <application> element is expanded or added. If the same marker is already there, the dialog says nothing needs to be written.
Write keeps the file's encoding. It detects UTF-8 with or without a byte order mark, UTF-16 little and big endian with or without a mark, and, from the XML declaration, ISO-8859-1 (also latin1 and the usual aliases) and US-ASCII. A file without a declaration is read as UTF-8. The dialog names the encoding. The package writes the result in the same encoding with the same byte order mark (or none), checks that the bytes read back as the same text and parse as XML, and only then writes the file and imports it. It refuses, with a sentence in a dialog and nothing written:
- any other encoding, such as
windows-1252, and UTF-32 - bytes that are not valid in the detected encoding (nothing is decoded with replacement characters)
- a byte order mark or byte layout that contradicts the XML declaration
- a result that holds a character the file's encoding cannot store
- a file that changed on disk after the preview was made
- a root element that binds the
toolsprefix to another namespace (orandroidto another than Android's), because a marker there would have no effect
After a successful write the window says: the file "was written. Build for Android again to see the effect."
What the helper does not offer, with the reason shown in the pane:
| Entry | Why |
|---|---|
| SDK levels | They come from the Gradle build configuration and cannot be removed with a merger marker. |
Queries, the glEsVersion feature, entries without a name, other entries |
Not supported in 1.0.0. |
Build system entries (Gradle build) |
Injected by the Gradle build; they cannot be removed with a merger marker. |
| Implied entries | Not declared by any manifest. Change what the merge trail gives as the reason. Markers for implied entries are not offered in this version. |
| Entries declared in your own custom manifest | Delete the line there. If another source declares the entry too, deleting your line leaves it in the build; the pane then shows the marker to replace your declaration with. It is copied, not inserted. |
Entries from Unity's launcher manifest, such as android:label and android:icon |
A marker in the custom main manifest cannot remove them. Observed: tools:remove="android:label" in the custom main manifest left the label in place. Removal through a custom launcher manifest was not run and is not offered. |
Observed with Unity 6000.3.12f1: a tools:node="remove" marker for FOREGROUND_SERVICE in the custom main manifest removed the permission an .androidlib declared (the merger log shows it added, then rejected), and a marker for INTERNET removed the permission Unity adds for Force Internet. The same marker file was built on Unity 6000.0.84f1 in the release checks; the effect on that version was not compared entry by entry.
Rules and the build-time check
The rules asset
Create one with Assets > Create > luanrobs > Android Manifest Inspector > Manifest Rules. It has six lists:
| List | Meaning |
|---|---|
| Forbidden Permissions | Each declared permission that matches an item is a violation. |
| Expected Permissions | Each item that no declared permission matches is a violation. |
| Allowed Permissions | When the list has at least one item, every declared permission must match an item of this list or of Expected Permissions. Empty means no allow-list. |
| Forbidden Features | As forbidden permissions, for uses-feature names. |
| Expected Features | As expected permissions, for features. |
| Allowed Features | As allowed permissions, for features. |
How items are read:
- Leading and trailing spaces are ignored. Empty items and items that start with
#are skipped. *matches any run of characters.${applicationId}stands for the package name of the inspected build.- In the permission lists an item that contains no dot, no
*and no$gets the prefixandroid.permission.:CAMERAmeansandroid.permission.CAMERA.*AD_IDand*stay as written. Feature items are full names. - Matching is case-sensitive and covers the whole name.
- Permission rules look at
uses-permissionanduses-permission-sdk-23entries. Feature rules look atuses-featureentries that have a name; the OpenGL ES version is not a feature for rules.
The result lists violations in a fixed order: forbidden, then not allowed, then missing expected; permissions before features; then by name. The messages are:
Forbidden permission <name> is declared by <source>.Permission <name> is not in the allowed list; it is declared by <source>.Expected permission <name> is not declared.
Feature rules use the same sentences with "feature".
Where the rules are checked
- In the window: Settings > Active Rules picks the asset. The Rules tab shows "Passed." or the violations, and clicking a violation selects its entry. Entries with a violation carry a marker in the list.
- In batch mode: see Batch mode.
- At build time, when Fail Build On Violation is on and an asset is set.
- From code:
ManifestRules.Evaluate(report).
The build-time check
With Fail Build On Violation on and an active rules asset, the post-build step, which runs after Gradle has produced the build, inspects the build that was just made and checks it. If a rule is broken it logs one error per violation, [AndroidManifestInspector] <message>, and throws a BuildFailedException with [AndroidManifestInspector] The Android manifest breaks N rule(s) of <rules name>. The build ends with Build Finished, Result: Failure.
- A failed check does not remove the APK or AAB. Gradle has already produced it, and it stays at the output path. Do not ship a build whose check failed.
- It fails closed. When the check is on and the build cannot be read, or no Gradle output matches the build's backend and variant, the build fails too, with
[AndroidManifestInspector] The build could not be inspected: <reason>and "The Android manifest could not be read, so the rules of <rules name> were not checked." - Exported projects are skipped. When Export Project is on in the Android build settings, Gradle has not run; the Gradle folder under
Librarystill holds the build before. Nothing is inspected, and with the check on the log has one warning:[AndroidManifestInspector] Exported projects are not checked: Gradle has not run yet. - A rules asset that went missing does not fail the build. If the settings name a rules asset that the project no longer has (deleted, not committed, recreated with a new GUID), each Android build logs a warning that no rules were checked, and goes on as with the check off. Assign the asset again in the window. Batch mode treats this state as an error, so a gate never passes silently.
- The step picks the build by what it just made: the backend from
PlayerSettings.GetScriptingBackend(IL2CPP or Mono2x) and the variantdebugfor a development build, elserelease. It never falls back to another build. - With the check off and Inspect After Build on, a build that cannot be read logs one warning and the build goes on.
- It writes nothing to the log on success.
Batch mode
For a build machine or a CI job. Run it after the build, in the same Unity project, with the Editor in batch mode. Unity opens a project in one Editor at a time, so close any Editor that has the project open.
Unity -batchmode -quit -projectPath <project> -logFile <log file> -executeMethod Luanrobs.ManifestInspector.ManifestInspectorBatch.Run <arguments>
Run prints the Markdown report and a summary to the Editor log and quits the Editor with the exit code. Arguments that do not start with -manifest are ignored, so the whole Unity command line can be passed. Argument names are not case-sensitive. A value is the argument after the name; it counts as missing when there is none or when it starts with -.
| Argument | Meaning |
|---|---|
-manifestGradleProject <folder> |
Inspect this Gradle project (absolute, or relative to the Unity project) instead of the newest build of the project. |
-manifestVariant <variant> |
Inspect only a build of this variant (debug or release). Also works with -manifestGradleProject. |
-manifestBackend <IL2CPP or Mono2x> |
Inspect only a build of this scripting backend (Mono is read as Mono2x; not case-sensitive). Not allowed with -manifestGradleProject. |
-manifestRules <asset path or GUID> |
Check against this rules asset instead of the active rules of the project. A value of 32 hexadecimal digits is a GUID, anything else an asset path. |
-manifestForbid <permission> |
Add one forbidden permission pattern. May be repeated. Works with or without a rules asset; the asset is not changed. Without an asset the rules are named command line. |
-manifestExport <file> |
Write the report to a .md, .markdown, .json or .csv file. May be repeated. Use an absolute path. |
-manifestSnapshot |
Save a snapshot and include the changes since the previous snapshot in the output. If the snapshot cannot be read or written, a WARNING: line says so and the run goes on. |
Without -manifestVariant and -manifestBackend the newest build is chosen as described in Reading a build. Give both on a machine that builds several variants or backends, so the gate reads the build it has to check.
Exit codes:
| Code | Meaning |
|---|---|
| 0 | The build was inspected and no rule is broken, or there were no rules. |
| 10 | At least one rule is broken. |
| 11 | There is no build to inspect, the Gradle project folder does not exist, no build matches -manifestVariant or -manifestBackend, or the build output could not be read. |
| 12 | An argument or a setting is wrong: an unknown argument, a missing value, a rules asset that is not found, a rules asset set in the settings that the project no longer has (and no -manifestRules), an export extension that is not supported, an export file that cannot be written, -manifestBackend together with -manifestGradleProject, or an unusable Gradle project path. |
| 1 | An unexpected exception. The log has an ERROR line with the exception name. Unity itself also returns 1 for its own failures, such as a compile error in the project. |
The last lines of the output:
[AndroidManifestInspector] VIOLATION: Forbidden permission android.permission.RECORD_AUDIO is declared by Unity.
[AndroidManifestInspector] RULES FAIL: 1 violation(s)
[AndroidManifestInspector] RULES PASS: Manifest Rules
[AndroidManifestInspector] NO RULES: the build was inspected, nothing was checked
An error prints [AndroidManifestInspector] ERROR: <message>; with no build the message is "No Android Gradle build output was found for this project. Build for Android first." NO RULES exits with 0: pass a rules asset or a -manifestForbid item if the job is a gate.
A CI example for a Windows build machine. The exit codes 0 and 10 were observed with -manifestForbid (see Tested on); this batch file was not run as written:
"C:\Program Files\Unity\Hub\Editor\6000.3.12f1\Editor\Unity.exe" -batchmode -quit ^
-projectPath C:\Builds\MyGame -logFile C:\Builds\manifest-check.log ^
-executeMethod Luanrobs.ManifestInspector.ManifestInspectorBatch.Run ^
-manifestVariant release -manifestBackend IL2CPP ^
-manifestRules "Assets/Rules/Release Manifest Rules.asset" ^
-manifestExport C:\Builds\manifest-report.md -manifestExport C:\Builds\manifest-report.json
if %ERRORLEVEL% EQU 10 echo The manifest breaks a rule.
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
The same arguments work on other operating systems; the Editor was only run on Windows.
From your own code, ManifestInspectorBatch.Execute(args, writer) does the same work without quitting the Editor and returns the exit code.
Exports
Export in the window writes the report on screen; ManifestReportExporter and -manifestExport do the same from code and from batch mode. Output is UTF-8 without a byte order mark, with \n line ends and culture-invariant numbers and dates, and contains no absolute path of the machine that made the build. The format comes from the extension: .md and .markdown, .json, .csv.
Markdown has this shape; sections without content are left out:
# Android manifest report: com.example.game
| | |
| --- | --- |
| Package | com.example.game |
| Version | 1.0 (1) |
| SDK | min 25, target 36, compile 36 |
| Build | release, IL2CPP, 2026-10-03 15:59:58 UTC |
| Unity | 6000.3.12f1 |
| Entries | 42 |
> Warning: <one line per warning>
## Rules: Manifest Rules
Passed.
## Changes since 2026-10-02 10:00:00 UTC
No changes.
## Permissions (12)
| Name | Value | Badges | Source | Declared in |
| --- | --- | --- | --- | --- |
| `android.permission.INTERNET` | | | Unity | <gradle>/unityLibrary/src/main/AndroidManifest.xml:3 |
Details: unknown SDK levels (0) are written as "unknown". The Rules section is there when rules were checked (Passed. or "N violation(s):" with one line per violation) and the Changes section when a previous build was found. A | inside a table cell is written \|. The "Declared in" column is the asset path, else the Maven coordinates, else the manifest path with the line.
JSON is the snapshot format shown in Changes and snapshots.
CSV has one row per entry, with the header:
key,group,kind,name,value,badges,source_kind,source,asset_path,package,coordinates,manifest_path,line
Enums are C# names, badges are C# names joined with ; (an entry without badges has an empty field), fields are quoted per RFC 4180 and line ends are \n.
Settings
The Settings menu of the window and ManifestInspectorSettings set the same values. They are stored in ProjectSettings/Luanrobs.ManifestInspector.asset, so a team and a build machine share them through version control. The rules asset is stored as a GUID.
| Setting | Type | Default | Description |
|---|---|---|---|
Active Rules (ActiveRules) |
ManifestRules |
none | The rules asset the window, the build-time check and batch mode check against. Must be an asset saved in the project. |
Inspect After Build (InspectAfterBuild) |
bool |
on | Read the merged manifest after every Android build made through Gradle, save a snapshot, make it LastReport, raise BuildInspected and refresh the window. |
Fail Build On Violation (FailBuildOnViolation) |
bool |
off | End an Android build with an error when it breaks a rule of the active rules asset. Has no effect while no rules asset is set. When on and rules are set, builds are inspected even while Inspect After Build is off. |
Snapshot Folder (SnapshotFolder) |
string |
Library/Luanrobs.ManifestInspector/Snapshots |
Where snapshots are saved: absolute, or relative to the Unity project folder. Reset Snapshot Folder restores the default. |
MaxSnapshots |
int |
20 | Snapshots kept per variant, from 1 to 500. Set from code only. |
What the package writes to disk: the snapshots, the export files you ask for, ProjectSettings/Luanrobs.ManifestInspector.asset, Library/Luanrobs.ManifestInspector/LastBuild.txt, and Assets/Plugins/Android/AndroidManifest.xml from Write after the preview. Per-user window state (splitter position, last folders) goes to EditorPrefs under Luanrobs.ManifestInspector.Window.<Key>. Reading never writes to the project. The package never opens a web page on its own.
Using the API from your own code
All of it is Editor code in the namespace Luanrobs.ManifestInspector, assembly Luanrobs.ManifestInspector.Editor. If your scripts live in an assembly definition, add a reference to Luanrobs.ManifestInspector.Editor and make the assembly Editor only. Call everything from the main thread of the Editor; calls are synchronous.
Failure model:
- Wrong arguments throw
ArgumentNullExceptionorArgumentException. - A folder that does not exist throws
DirectoryNotFoundException, a fileFileNotFoundException. - Output that exists but cannot be used throws
ManifestInspectorExceptionwith a sentence you can show to a user. - No build is not an error:
InspectLatestBuild()returns null andFindBuilds()returns an empty list. - A missing blame report or merger log is not an error: the report has
HasMergerReportfalse or a sentence inWarnings.
Check a build from your own build method
using Luanrobs.ManifestInspector;
using UnityEditor;
using UnityEngine;
public static class ManifestCheck
{
// Run after the Android build: -executeMethod ManifestCheck.Run
public static void Run()
{
ManifestRules rules = AssetDatabase.LoadAssetAtPath<ManifestRules>("Assets/Rules/Release Manifest Rules.asset");
ManifestReport report = AndroidManifestInspector.InspectLatestBuild();
if (rules == null || report == null)
{
EditorApplication.Exit(2);
return;
}
ManifestRulesResult result = rules.Evaluate(report);
foreach (ManifestRuleViolation violation in result.Violations)
{
Debug.LogError(violation.Message);
}
EditorApplication.Exit(result.Passed ? 0 : 3);
}
}
React to every inspected build
using Luanrobs.ManifestInspector;
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
public static class ManifestWatcher
{
static ManifestWatcher()
{
AndroidManifestInspector.BuildInspected += OnBuildInspected;
}
private static void OnBuildInspected(ManifestReport report)
{
Debug.Log(report.PackageName + " declares " + report.Entries.Count + " entries.");
}
}
BuildInspected is raised on the main thread after the post-build step inspected an Android build made by this Editor. It is not raised by the Inspect methods. Each subscriber is called on its own: an exception in one is logged with Debug.LogException and does not stop the others. Subscribing twice with the same method subscribes once.
Compare with the previous build and export
using Luanrobs.ManifestInspector;
using UnityEditor;
public static class ManifestExportExample
{
[MenuItem("Tools/My Project/Export Manifest Report")]
public static void Run()
{
ManifestReport current = AndroidManifestInspector.InspectLatestBuild();
if (current == null)
{
return;
}
ManifestReport previous = ManifestSnapshots.LoadPrevious(current);
ManifestChanges changes = previous == null ? null : ManifestComparison.Compare(previous, current);
ManifestRulesResult rules = null;
ManifestRules active = ManifestInspectorSettings.ActiveRules;
if (active != null)
{
rules = active.Evaluate(current);
}
ManifestReportExporter.Export(current, "Builds/manifest-report.md", ManifestReportFormat.Markdown, rules, changes);
}
}
Inspect* does not save a snapshot. LoadPrevious finds one only if the post-build step, the window or batch mode with -manifestSnapshot saved one before.
Get a removal snippet and preview it
using Luanrobs.ManifestInspector;
using UnityEngine;
public static class RemovalExample
{
public static string PreviewRemoval(ManifestEntry entry, string customManifestText)
{
ManifestRemovalSnippet snippet = ManifestRemoval.GetSnippet(entry);
if (!snippet.IsSupported)
{
Debug.Log(snippet.UnsupportedReason);
return customManifestText;
}
return snippet.CanInsert ? ManifestRemoval.Preview(customManifestText, snippet) : customManifestText;
}
}
Preview returns text and writes nothing. The only code path that writes the custom main manifest is the Write button of the window.
Domain Reload
The package has no runtime code, so Play mode and player builds never load it. In the Editor:
AndroidManifestInspector.LastReportis a cache. It is lost on a domain reload and is not read back from disk, so treat it as possibly null at any time.- After every domain reload (each script compile, and Enter Play Mode with Domain Reload on) an open window whose source is Newest Build inspects the build again, and the first source lookup walks
Assets/,Packages/andLibrary/PackageCache/for.androidlibfolders and.aarfiles. A measurement of that walk on 2,492 folders outside the Editor, on .NET 8, took about 0.4 to 1.3 seconds; it was not timed in the Editor. This reading saves no snapshot. - Windows subscribe to
BuildInspectedinOnEnableand unsubscribe inOnDisable. Static event hook-ups of the package use-=then+=, so with Enter Play Mode Options and Domain Reload disabled a subscriber is called once per event. - Nothing opens a window, shows a dialog or logs when the Editor loads.
Checked in a clean Unity 6000.3.12f1 project (2026-10-20, before the final fixes): with Domain Reload disabled, three Play sessions in a row left the statics, LastReport and the settings as they were in Edit mode, with one subscriber call per event.
Platform support
| Platform | What happens |
|---|---|
| Android, Gradle build, APK, Mono and IL2CPP | Supported: the build is read and shown. Run on Windows (see Tested on). |
| Android, App Bundle (AAB) | Observed while developing: an AAB build leaves the same files in the same folders as an APK build of the same variant. The package was not run on an AAB build. |
| Android, exported Gradle project | The post-build step skips it (Gradle has not run). Build the exported project, then open its folder with Source > Open Gradle Project.... That path was not run on an exported project built in Android Studio. |
| Unity Editor on Windows | Run. |
| Unity Editor on macOS and Linux | Not run. |
| iOS, WebGL, desktop and console players | Not supported: the tool reads Android manifests only. |
Tested on
This table lists what was run for version 1.0.0. Everything marked "not run" was not run. All runs were on 2026-10-20, on Windows 11, in batch mode unless said otherwise, by automated tests and scripted checks. The final fixes mentioned below were the last changes to the code of this release.
| What | Result |
|---|---|
| EditMode tests, Unity 6000.3.12f1, development project, first code | 323 of 323 passed. |
EditMode tests, new clean projects with the package installed from a .tgz archive and the Demo sample imported, final code |
358 of 358 passed on Unity 6000.3.12f1 and 358 of 358 on Unity 6000.0.84f1; the sample imported with no errors. Earlier code: 323 of 323 on each. |
| Android builds, Unity 6000.3.12f1, development project | Mono APK builds with a plain project, with Unity API triggers and Force Internet and Force SD card on in a development build, and with an .androidlib plus remove markers in a custom main manifest. A scripted check of the Editor API read each build, and the report of the plain build met all 75 expectations of the stored reference build of the same Unity version. |
| Android builds, clean projects (code before the final fixes) | Unity 6000.3.12f1: Mono plain build and IL2CPP plain build (ARM64). Unity 6000.0.84f1: Mono plain build, development build with all triggers, and the .androidlib build with remove markers and Force Internet. Each was read by the scripted check, which passed. |
| Android builds, final code | Clean projects, Mono plain build on Unity 6000.3.12f1 and on 6000.0.84f1, each followed by an Editor smoke run that passed; Unity 6000.0.84f1 development build with all triggers. Earlier on Unity 6000.3.12f1 the report of the plain build met all 75 expectations of the stored reference build. |
| Reference builds | The tests read seven stored real builds (Mono and IL2CPP, Unity 6000.3.12f1 and 6000.0.84f1, with a development build, an .androidlib, a local .aar, an implied record and a custom main manifest with remove markers). |
| Batch mode | On Unity 6000.0.84f1 with the final code, and earlier on Unity 6000.3.12f1 and 6000.0.84f1: -manifestForbid RECORD_AUDIO on the development build with all triggers exited with 10 and RULES FAIL; -manifestForbid BLUETOOTH_SCAN exited with 0 and RULES PASS. |
| Build-time check | Earlier code, Unity 6000.3.12f1 and 6000.0.84f1: with Fail Build On Violation and a rules asset, the build failed with "The Android manifest breaks 1 rule(s)" and Build Finished, Result: Failure. In an exported-project build the log had "Exported projects are not checked". |
| Failed check leaves the build output | Observed in a spike build on Unity 6000.3.12f1 on 2026-10-15: the APK stayed at the output path. |
| Window | Opened in the light and in the dark Editor skin on Unity 6000.3.12f1 (first code): a capture method saved the pixels of the Entries tab with an entry selected, the Changes tab and the Rules tab, and reported that none of the images was blank. The logic behind the window (the view model, the removal preview and the encoding handling) is covered by the EditMode tests. The menus, file dialogs and the Write dialog were not driven through the interface in these runs. |
| Nothing of the package in a player | Each Android build above was followed by a check of its build report; it found no packed asset and no file whose path contains the package name, and logged PLAYER CLEAN. |
| Domain Reload disabled | Unity 6000.3.12f1, clean project, final code: three Play sessions in a row passed. |
Not run:
- macOS and Linux Editors
- App Bundle builds and exported Gradle projects built in Android Studio
- real third-party SDKs (ad, analytics, Firebase or similar): the
.androidliband.aarused in the runs were small test files made for them - Unity 6000.1 and Unity 6000.2, and Unity 6000.0 patches before 84f1
- IL2CPP builds on Unity 6000.0.84f1 (the IL2CPP reference build of that version is stored and was read by the tests)
- a custom launcher manifest with remove markers
- the window driven by mouse and keyboard
Limitations
These are known and stated up front.
- Android builds made through Gradle only. No iOS, no privacy manifests, no builds from another machine.
- Read-only unless you click Write. It does not edit your manifests, start builds, resolve Gradle dependency conflicts or fix build errors.
- "Unity" is a manifest, not a script. The tool says the declaration is in the manifest Unity generated. It does not name the script or assembly that uses an API. Only the seven permissions in the table above have a specific explanation.
- Maven artifacts are named by coordinates. The tool does not tell which plugin added the dependency.
- The Play-sensitive and runtime lists are fixed in this version. They were read on 2026-10-08 and do not update.
- No Native Libraries view.
.sofiles and page alignment are not examined. - Removal is limited. No markers for queries, SDK levels, implied entries, the
glEsVersionfeature or entries from Unity's launcher manifest (see How to remove an entry). - A failed build-time check leaves the APK or AAB in place. Gradle has already produced it.
- An unchanged rebuild keeps the old build time. The build time is the write time of the merged manifest.
- Newest build without a record. After inspection was turned off, or for builds made without the package, the newest build is the one whose merged manifest changed last. Pass
-manifestVariantand-manifestBackendto batch mode on a machine that builds several. - Snapshot names can collide. A snapshot file is named by the build time (to the second) and the variant, with no backend and no package name. IL2CPP and Mono builds of the same variant whose merged manifests were written in the same second, or two apps that share one chosen snapshot folder, share one file, and the later one replaces the earlier.
- Custom-manifest attribution reflects the files as they are now. A manifest you edited after the build changes the attribution; the window warns when the custom manifests are newer than the build. A snapshot made by the post-build step is not replaced by a later reading.
- Domain reloads re-read the build. After each domain reload an open window with the source Newest Build inspects the build again, and the first lookup walks your project folders.
- Preview and prefixes. When a custom main manifest binds the Android namespace to a prefix other than
android, Preview adds a second, equivalent marker with the standard prefixes and the twoxmlnsdeclarations it needs. The result is well-formed and the merger reads both. Preview matches an existing marker by thetoolsnamespace but by the literal nameandroid:name. - Windows long paths. Gradle's report paths often exceed 260 characters. The package opens files through the long-path prefix on Windows; the file functions were probed inside the Editor on a path of 363 characters, and a test covers a path longer than 260 characters.
- English only.
API reference
Namespace: Luanrobs.ManifestInspector. Assembly: Luanrobs.ManifestInspector.Editor (Editor only).
AndroidManifestInspector
public static class AndroidManifestInspector
| Member | Description |
|---|---|
const string Version |
The package version, "1.0.0". |
event Action<ManifestReport> BuildInspected |
Raised after the post-build step inspected an Android build of this Editor. |
ManifestReport LastReport |
The report most recently produced by an Inspect method or the post-build step, or null. A cache, lost on domain reload. |
IReadOnlyList<ManifestBuildLocation> FindBuilds() |
The Android Gradle builds of the project, newest first by build time. Empty when there are none. |
IReadOnlyList<ManifestBuildLocation> FindBuilds(string gradleProjectPath) |
The build variants of one Gradle project. Throws DirectoryNotFoundException for a missing folder. |
ManifestReport InspectLatestBuild() |
Inspects the newest build of the project (see Reading a build). Null when the project has no Android Gradle build output. |
ManifestReport Inspect(string gradleProjectPath) |
Inspects the newest variant of one Gradle project. A relative path is resolved against the Unity project folder. |
ManifestReport Inspect(string gradleProjectPath, string variant) |
As above for one variant; null or empty means the newest. |
ManifestReport Inspect(ManifestBuildLocation location) |
Inspects one build from FindBuilds. Sets LastReport; saves no snapshot. |
ManifestReport
public sealed class ManifestReport. Read-only; strings and lists are never null.
| Member | Description |
|---|---|
PackageName, VersionName, VersionCode |
From the merged manifest. |
MinSdkVersion, TargetSdkVersion, CompileSdkVersion |
SDK levels; 0 when unknown. |
Variant, ScriptingBackend |
release or debug; IL2CPP or Mono2x (empty for a Gradle project opened from another folder). |
UnityVersion, InspectorVersion |
The Editor and the package version that produced the report. |
BuildTimeUtc |
The write time of the merged manifest, in UTC. The identity of a build for snapshots. |
HasMergerReport |
False when the build left neither a blame report nor a merger log. |
Location |
The files read (ManifestBuildLocation); null for a report loaded from a snapshot. |
Entries, Warnings |
The entries in a fixed order; sentences about things that could not be read. |
Find(string key), GetEntries(ManifestEntryGroup group) |
Look up an entry; the entries of one group. |
ManifestEntry
public sealed class ManifestEntry
| Member | Description |
|---|---|
Key, Kind, Group, Tag, Name, Value |
Identity and display values (see Reading a build). |
Attributes, IntentFilters, Xml, Line |
The element's attributes, the intent filters of a component, its canonical XML and its line in the merged manifest. |
Source |
A ManifestSource; never null. |
Trail |
The merge trail, a list of MergeStep. |
Badges, Notes, HasBadge(ManifestBadges) |
Badge flags and one sentence per badge. |
Exported, Required, MaxSdkVersion |
Nullable convenience values: android:exported, android:required, android:maxSdkVersion. |
GetAttribute(string qualifiedName) |
The value of an attribute, or null. |
ManifestSource and MergeStep
| Type | Members |
|---|---|
ManifestSource |
Kind (ManifestSourceKind), DisplayName, AssetPath, PackageName, Coordinates, ManifestPath, Line, Explanation. |
MergeStep |
Action (MergeAction), Attribute, Module, Label, Path, Line, Column, Reason. |
Enums
| Enum | Values |
|---|---|
ManifestEntryKind |
Permission, PermissionSdk23, PermissionDeclaration, Feature, Query, Activity, ActivityAlias, Service, Receiver, Provider, MetaData, ApplicationAttribute, Sdk, Other |
ManifestEntryGroup |
Permissions, Features, Queries, Components, MetaData, Application, Sdk, Other |
ManifestBadges (flags) |
None, Dangerous, PlaySensitive, ExportedUnprotected, Implied, Insecure |
ManifestSourceKind |
Unknown, Unity, CustomManifest, AndroidLibrary, Aar, MavenArtifact, GradleModule, BuildSystem |
MergeAction |
Unknown, Added, Merged, Injected, Rejected, Implied, Converted |
ManifestChangeKind |
Added, Removed, Changed |
ManifestRuleViolationKind |
Forbidden, NotAllowed, MissingExpected |
ManifestReportFormat |
Markdown, Json, Csv |
ManifestBuildLocation
public sealed class ManifestBuildLocation: GradleProjectPath, AppModule, Variant, ScriptingBackend, MergedManifestPath, BlameReportPath, MergerLogPath, BuildGradlePath, BuildTimeUtc.
ManifestInspectorSettings
public static class ManifestInspectorSettings
| Member | Description |
|---|---|
ManifestRules ActiveRules { get; set; } |
The rules asset. Setting an object that is not a saved asset throws ArgumentException. |
bool InspectAfterBuild { get; set; } |
Default true. |
bool FailBuildOnViolation { get; set; } |
Default false. |
string SnapshotFolder { get; set; } |
Default DefaultSnapshotFolder; null or empty restores it. |
int MaxSnapshots { get; set; } |
Default 20, clamped to 1..500, per variant. |
const string DefaultSnapshotFolder, const int DefaultMaxSnapshots |
The defaults. |
Every setter saves at once.
ManifestSnapshots
public static class ManifestSnapshots
| Member | Description |
|---|---|
const int FormatVersion |
1. |
const string FileExtension |
".json". |
string Folder |
The absolute snapshot folder. |
string Save(ManifestReport report) |
Saves into Folder and prunes old files of the same variant. Returns the path. |
void Write(ManifestReport report, string filePath) |
Writes snapshot JSON to any file. |
ManifestReport Load(string filePath) |
Reads a snapshot. Throws ManifestInspectorException for a file that is not a snapshot or is newer than this version. |
IReadOnlyList<ManifestSnapshotInfo> List() |
The snapshot files of Folder, newest first (FilePath, BuildTimeUtc, Variant). |
ManifestReport LoadPrevious(ManifestReport current) |
The newest earlier snapshot with the same package name and variant, or null. |
string ToJson(ManifestReport), ManifestReport FromJson(string) |
The same format in memory. |
ManifestComparison and ManifestChanges
ManifestChanges ManifestComparison.Compare(ManifestReport previous, ManifestReport current). ManifestChanges has Changes (added, then removed, then changed), PreviousBuildTimeUtc, CurrentBuildTimeUtc, AddedCount, RemovedCount, ChangedCount and IsEmpty. A ManifestChange has Kind, Key, Before, After, Entry (the current entry, else the previous one) and Differences.
ManifestRules
public sealed class ManifestRules : ScriptableObject
| Member | Description |
|---|---|
List<string> forbiddenPermissions, expectedPermissions, allowedPermissions |
The permission lists. |
List<string> forbiddenFeatures, expectedFeatures, allowedFeatures |
The feature lists. |
ManifestRulesResult Evaluate(ManifestReport report) |
Checks a report. Logs nothing, changes nothing. |
ManifestRulesResult has RulesName, Violations and Passed. A ManifestRuleViolation has Kind, EntryKind, Name, Pattern, Entry (null for a missing expected item) and Message.
ManifestRemoval
public static class ManifestRemoval
| Member | Description |
|---|---|
const string CustomMainManifestPath |
Assets/Plugins/Android/AndroidManifest.xml. |
const string ToolsNamespace |
http://schemas.android.com/tools. |
ManifestRemovalSnippet GetSnippet(ManifestEntry entry) |
The snippet for an entry; IsSupported false with an UnsupportedReason when none is offered. |
string Preview(string manifestXml, ManifestRemovalSnippet snippet) |
The manifest text with the snippet inserted. Writes nothing. Throws ArgumentException when CanInsert is false and ManifestInspectorException when the text is not a well-formed Android manifest. |
ManifestRemovalSnippet has IsSupported, Xml, ParentElement, IsAttribute, CanInsert, Instructions and UnsupportedReason.
ManifestReportExporter
public static class ManifestReportExporter: ToMarkdown(report, rules = null, changes = null), ToJson(report), ToCsv(report), Export(report, filePath, format, rules = null, changes = null) and FormatFromExtension(filePath). rules and changes are used by the Markdown format only. Export creates the folder and replaces an existing file.
ManifestInspectorBatch
public static class ManifestInspectorBatch: constants ExitOk (0), ExitRuleBroken (10), ExitNoBuild (11), ExitBadArguments (12); Run() for -executeMethod; Execute(string[] args, TextWriter output) returning the exit code without quitting.
ManifestInspectorWindow
public sealed class ManifestInspectorWindow : EditorWindow
| Member | Description |
|---|---|
const string MenuPath |
Tools/luanrobs/Android Manifest Inspector/Open Inspector. |
static ManifestInspectorWindow Open() |
Opens or focuses the window. |
ManifestReport Report |
The report on screen. |
void ShowReport(ManifestReport report) |
Shows a report you give it. |
void Refresh() |
Reads the current source again. |
void ShowTab(ManifestInspectorTab tab) |
Entries, Changes or Rules. |
bool SelectEntry(string key) |
Selects the entry with that key; false when there is none. |
ManifestInspectorException derives from Exception and carries a sentence that can be shown to the user.
Troubleshooting and FAQ
The window says no Android build output was found
The package reads Library/Bee/Android/Prj/<backend>/Gradle of this project. Build for Android first. The folder is gone after you delete Library, and an exported project does not update it because Gradle has not run. For a Gradle project in another place use Source > Open Gradle Project....
Building again shows the old build
Gradle does not rewrite the merged manifest when nothing changed, so the build time stays at the last build that changed it. Click Refresh. If Inspect After Build is off, nothing refreshes by itself. With several variants or backends, choose the build in the Source menu.
The report says the build left no manifest merger report
The window shows: "The build left no manifest merger report next to the merged manifest, so the source of each entry is unknown." Every source is then Unknown. Build again with a Gradle build; the reports are written next to the merged manifest. If only the blame report is missing the window says the sources were read from the merger log, which is less precise for nested elements.
Entries say "Unity" but I never used that API
"Unity" means the declaration is in the manifest Unity generated. A plugin build callback can write there too. The tool does not know which script or setting caused it. See What Unity adds, and why.
A source shows as Unknown
The blame report and the merger log say nothing about the entry, or the blame report did not match the merged manifest (the build may be incomplete). The entry is listed with its manifest line.
The window warns that a custom manifest is newer than the build
You changed Assets/Plugins/Android/AndroidManifest.xml or LauncherManifest.xml after the build. Entries attributed to your custom manifests reflect the file as it is now. Build again.
The build failed but the APK is there
That is how the build-time check works: Gradle had finished before the check ran. Do not ship that file. See The build-time check.
The build-time check did nothing on an exported project
Exported projects are not checked, because Gradle has not run. The log has one warning when the check is on. Build the exported project with Gradle and check it with batch mode: -manifestGradleProject <folder>.
The log says the rules asset was not found
The settings hold the GUID of a rules asset that the project no longer has. Open Settings > Active Rules in the window and assign the asset again. If the settings file ProjectSettings/Luanrobs.ManifestInspector.asset is under version control, commit the rules asset together with its .meta file.
Batch mode exits with 11
There is no build, the folder you passed does not exist, no build matches -manifestVariant and -manifestBackend, or the merged manifest cannot be read. The line starting [AndroidManifestInspector] ERROR: says which.
Batch mode exits with 0 but checked nothing
The last line is NO RULES. Pass -manifestRules or -manifestForbid, or set an active rules asset.
Batch mode checked the wrong build
On a machine that builds several variants or backends, pass -manifestVariant and -manifestBackend. Without a record from the post-build step, the newest build is the one whose merged manifest changed last.
Debug and release builds are side by side
Each has its own merged manifest and reports under the same backend folder. Choose one in the Source menu, or pass -manifestVariant. Mono and IL2CPP builds sit in separate folders, Mono2x and IL2CPP.
App Bundle builds
An App Bundle build leaves the same files as an APK build of the same variant, as observed. The package was not run on an AAB build; if the window shows nothing, report it with your Unity version.
Where does each Unity version leave the files?
Both versions run here put the Gradle project in Library/Bee/Android/Prj/<IL2CPP or Mono2x>/Gradle, with the modules launcher, unityLibrary and one per .androidlib. Other versions were not inspected.
Paths are long and files cannot be opened on Windows
The package opens files through the Windows long-path prefix, so Gradle's deep report paths work. If a file still cannot be opened, report it with the length of the path.
Write refuses my manifest
The dialog names the reason: an unsupported encoding (such as windows-1252 or UTF-32), bytes that are invalid in the declared encoding, a file that changed after the preview, or a tools prefix bound to another namespace. Fix the file, or copy the snippet and add it yourself.
The marker did not remove the attribute
A marker in the custom main manifest cannot remove an attribute that Unity's launcher manifest declares, such as android:label. The pane says so for those entries.
The Changes tab says there is no previous build
No snapshot of an earlier build with the same package name and variant exists in the snapshot folder. Snapshots are saved by the post-build step, Refresh and the Source menu, and they are lost when Library is deleted if the snapshot folder is the default.
Nothing happens in Play mode with Domain Reload disabled
The package has no runtime part. Its Editor statics are safe with Domain Reload disabled (see Domain Reload).
Support
Email: luanrobs@gmail.com
When reporting a problem, please include your Unity version, the scripting backend and variant of the build, the Console output and, if you can, the snapshot or Markdown export of the report (they contain no absolute path of your machine).
Product page: https://luanrobs.com/android-manifest-inspector/
Manual online: https://luanrobs.com/android-manifest-inspector/docs/
Changelog: https://luanrobs.com/android-manifest-inspector/changelog/
I maintain and support this package myself. If it saves you time, a review on the Asset Store helps a lot. Thank you.