
People search for “dnSpy for Android” for two different reasons. Some hope to install dnSpy on a phone. Others have an Android app, often a Unity game or a Xamarin or .NET MAUI app, and want to read the C# code inside it. The first is not possible: there is no Android version of dnSpy. The second often is, because many Android apps carry ordinary .NET assemblies that dnSpy on a Windows PC can open. This guide explains where those assemblies live, how to extract them, and when there is no IL to find at all.
Why dnSpy does not run on Android
dnSpy is a Windows desktop application built on WPF. It depends on Windows APIs for its interface, file handling and debugger. Android uses a completely different application model, and the screen size alone would make a tree-and-code-pane tool awkward. Apps in mobile stores that use dnSpy’s name are not the real project, and some exist only to show ads or collect data. Avoid them.
The practical approach is to do the analysis on a PC: copy the APK from the device or obtain it from your own build output, extract the .NET assemblies, and open them in dnSpy.
Stay on the right side of the rules: analyse apps you built yourself, apps whose licence allows it, or apps you have explicit permission to study, for example as part of a security assessment. Game terms of service often forbid modification, and cheating in online games harms other players.
An APK is a zip archive
Every APK is a standard zip file with a different extension. Rename a copy to .zip, or open it directly with 7-Zip, and you can browse its folders. What you find inside tells you which technology the app uses:
| You find | Technology | Can dnSpy read the code? |
|---|---|---|
assets/bin/Data/Managed/*.dll including Assembly-CSharp.dll | Unity with the Mono backend | Yes, directly |
lib/<abi>/libil2cpp.so and global-metadata.dat | Unity with IL2CPP | No IL; only type information after conversion |
assemblies/ folder or files named like assemblies.blob | Xamarin.Android or .NET for Android (MAUI) | Yes, after extraction or decompression |
Only classes.dex files | Java or Kotlin | No; use a Java decompiler instead |
Many apps contain a mix, for example a Unity game with Java plug-ins. Focus on the part that is relevant to your question.
Unity games built with Mono
This is the easiest case. Unity compiles game scripts into .NET assemblies. When the developer chooses the Mono scripting backend, those assemblies are shipped as normal DLLs:
- Copy the APK to your PC and open it with an archive tool.
- Navigate to
assets/bin/Data/Managed/. - Extract all DLLs in that folder into one working directory, so dnSpy can resolve references between them.
- Open
Assembly-CSharp.dllin dnSpy. This assembly contains the game’s own scripts. Also look atAssembly-CSharp-firstpass.dlland any assemblies named after the developer’s namespaces.
Classes derive from MonoBehaviour, and Unity calls methods such as Awake, Start and Update by name. Searching for those methods, or for strings shown in the game’s interface, is a quick way to find relevant code.
dnSpy can save edits to these DLLs, but repacking an APK requires re-signing it, and modified apps will not install as updates over the original. For learning and modding on your own builds, rebuilding from the Unity project is usually simpler.
Unity games built with IL2CPP
Most current Unity games on Android use IL2CPP. During the build, Unity converts the IL into C++ and compiles it into native ARM code in libil2cpp.so. The original method bodies no longer exist as IL, so dnSpy cannot decompile them.
What survives is metadata: class names, method signatures and fields are stored in global-metadata.dat. Community tools such as Il2CppDumper read that metadata together with the native library and generate “dummy” assemblies. Opening those in dnSpy shows the structure of the game, with names, fields and signatures, plus attributes pointing to the native address of each method. The method bodies are empty. To understand actual logic, you need a native disassembler such as Ghidra.
In other words, for IL2CPP builds dnSpy becomes a map of the code, not a window into it.
Xamarin and .NET for Android apps
Apps built with Xamarin.Android or its successor, .NET for Android (used by .NET MAUI), run on a Mono-based runtime and ship .NET assemblies inside the APK. Their storage format has changed over the years:
- Older Xamarin apps store DLLs in an
assemblies/folder. Some are compressed; a file that starts with the charactersXALZis LZ4-compressed and must be decompressed before dnSpy can open it. - Newer builds pack assemblies into binary “assembly store” blobs instead of individual files. In recent .NET versions these blobs may be stored as files that look like native libraries.
Community scripts exist that unpack these formats into ordinary DLLs; search for a tool that matches the Xamarin or .NET version the app was built with. Once extracted, the assemblies open in dnSpy like any other .NET library: you will see the app’s view models, services and API clients, alongside framework assemblies such as Mono.Android.dll and Microsoft.Maui.dll.
If the app was published with ahead-of-time compilation options, some or all code may also exist as native code. dnSpy will still show the IL for assemblies that retain it.
Debugging Android .NET code
dnSpy’s debugger works on Windows processes. It cannot attach to an app running on an Android device or emulator. For your own Xamarin or MAUI apps, debug with Visual Studio or Rider, which deploy a debuggable build to the device. For Unity, the Unity editor and IDE integrations support debugging development builds on Android.
dnSpy remains useful alongside those tools: it shows exactly what ended up in a release build, which is valuable when a release behaves differently from a debug build because of linker trimming or configuration differences.
Practical workflow summary
- Obtain the APK legitimately, ideally from your own build pipeline.
- Open it as a zip and identify the technology from the folder layout.
- Extract managed DLLs (Mono), unpack assembly stores (Xamarin/.NET for Android), or generate dummy assemblies (IL2CPP).
- Put all extracted assemblies in one folder and open the main ones in dnSpy on Windows.
- Use search, the Analyzer and the IL view to answer your question.
- For debugging, switch to the platform’s own tools.
Common problems
dnSpy says the file is not a .NET assembly
The DLL is compressed, part of an assembly store, or a native library. Check the first bytes in a hex viewer or in dnSpy’s hex editor: a valid assembly starts with MZ.
Types appear with unresolved references
Open the other assemblies from the same folder so dnSpy can resolve them. For Unity, include UnityEngine*.dll; for MAUI, include the framework assemblies from the package.
All the names are meaningless
The app is obfuscated. Some obfuscators can be partly reversed with de4dot, but many modern ones cannot, and obfuscation is often a clear signal that the author does not want the code studied.
Frequently asked questions
Is there any dnSpy APK I can install?
No genuine one. dnSpy is Windows-only, and APKs using its name are not from the project.
Can I edit an Android game with dnSpy and reinstall it?
Technically, for Mono-based Unity games, yes, but you would need to repack and re-sign the APK, and doing so for games you do not own may break their terms and the law. Use this only for your own projects.
What about iOS apps?
iOS forbids just-in-time compilation, so Unity and .NET apps on iOS are compiled ahead of time to native code. dnSpy can show little more than metadata, if any.
Summary
There is no dnSpy for Android, but dnSpy on a PC is a capable companion for Android apps written in C#. Unity games built with Mono and Xamarin or .NET for Android apps carry real .NET assemblies that dnSpy can decompile once extracted. IL2CPP and fully native builds leave only metadata. Identify the technology from the APK’s folders, extract the right files, and keep your work within the permissions you have.