Jemandem den Schuh aufblasen

Example: "dann hat er ihm aber anständig den Schuh aufgeblasen"
"ich blase dir gleich den Schuh auf"

It is used seriously, but it is still a kind of friendly. Just people who know each other well (not formal).
It is like a funny threat when you tease each other or joking, and the other person is going a bit too far.
You are not angry but want to give signal to stop this. This is used, when he (she) wants to stop somebody else to say or do something and to demand respect.

second use:
Sombody gives a ironical comment, which has double sense. When you don't know if the other person wants to test or provocate you.
To have no silly discussion with no result, with this sentence you just set the end, you show the limit and show your serious opinion and you demand clearness and respect.