The phrase "get a life" implies the current absence of "a life".
The very indirection of the phrase (by implication) indicates that the speaker is acting in a passive-aggressive manner. Whether the speaker's intention is humor, disdain, challenge, or rhetorical, this form of indirect attack is designed to be confusing to the target of the comment.
Put yourself in the target's shoes. You hear someone say to you: "get a life." You hear the words, and know the definition of each of them because you have memorized the dictionary. However, it is obvious to you that there is a hidden meaning behind the phrase. Your own personality, mindset, and attitude will be likely to bias your interpretation of the phrase and subjective evaluation of the hidden meaning.
Meanwhile, the speaker has seized that moment to consciously choose to throw you off balance with the comment. Why? Was the speaker losing the battle of wits and needed to jockey for a better wrestling position? Was the speaker trying to escalate a situation into a confrontation by throwing the first punch? Was the speaker acting or reacting out of habit, without understanding why that behavior exists in his or her persona/psyche? Was the speaker attempting to ingratiate himself/herself to you by acting a little too intimately for the situation?
Bottom line: The phrase "get a life" is an attack of some sort. The attacker knows it is an attack. The attacker also knows that the target can not possibly "know" exactly the hidden meaning behind the phrase.
It may not the the first punch in a confrontation, but it is a punch nonetheless. Friendly or otherwise.