Maybe you were looking for...

How do I test if a specific player is online?

I want to make a command block that detects if me or my friend are online using /execute. How can I accomplish this?