No flight I've ever been has ever had a dress code - is it any different wearing shorts than pyjamas? - but almost every Emirates flight I've ever been on has been freezing, I'd advise against shorts and think of wearing long johns instead
I was sitting in business once waiting for the rest of pax to board, I looked up to see a guy boarding with a nice suit jacket,collar and tie, and a pair of shorts with trainers on. Class !!
I also find most of Emirates flights to be on the cool side.
Best Regards
Flying Fireman