1. downloading the binary
2. jailbreaking the phone to extract the binary (pretty sure this is necessary on iOS)
3. check the version of the binary, then compile the original sources of the version
4. ??? compare the two binaries, this is likely the most difficult part, they won't be identical because of things like codesigning (and build flags, timestamps, ...)
I know noone that does this.