Is there any way to run an apk without installing? Just like in windows running an exe. Does being a native apk change anything in relation to this?
Short answer is:
You can't.
Long answer(TL;DR):
If compared to Windows's .exe file, which is binary, and can be executed, .apk is not a binary, and can't be executed. .apk in fact is a zip archive, just named with .apk instead of .zip.
For Android .apk is an application package, which has the executable code + resources + assets + whatever else it needs. This means that the .apk file is not being run itself.
How it works (simplified):
When you start an application on Android, system extracts .apk file, opens the manifest file, finds a launcher activity you have selected to start, and executes it's Activity.class code on the Java VM.
So in fact you can do that having root access by manually extracting APK, starting a virtual machine and running .class code in it, but IMHO it is not worth to do.
What you can run is most part of arm compiled Linux binaries. If they don't require access to the system-owned files, or other data, or you have root access on your device, you can use arm binaries. But you still need some APK installed to run them.
Note that the answer is simplified for easier understanding, and in fact everything is more complicated with APKs, Java VM, etc.
During apk installation (even via adb), managed by the android Package Manager on the device, various processes are executed such as:
There is no way an apk can run on an android device if it's resources and configuration are not on the same device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With