How to spy on someone’s phone?

How to spy on someone’s phone?
To spy on someone’s phone, it’s enough to install a spyware on the target device.

If it runs on Android OS, then a person willing to spy needs physical access to install the app. If the operating system is iOS, it’s enough to know the iCloud credentials. The 2-factor authentication must be disabled as well.