Usually when I'm applying an exam on my students, right before giving them the questions sheet, I tell them not to cheat. I usually warn them that I will not be inspecting their every move, but I will be watchful to make sure that no communication, electronic device or consulting will be done/used.
To complement this, I always make very mean and bad comments about cheating. Stuff like "your diploma will always be tainted if you go through the University by cheating, I'd rather use it to clean my soles" or "you had all the opportunities to ask questions, consult me, the textbooks, Youtube videos, lecture notes, class monitors and myself and the other teachers before this exam. I was always honest with you and expect the same thing in return and nothing else. If you're having personal problems that are affecting your studies, there are other ways to try to circunvent it instead of cheating". I once even said (with a class that I had some liberty to say so) that, by cheating, I wanted them to look at the mirror, every day of their lives, and face how much an intellectual failure they've become.
Now, I try to make it clear that those are jokes. But I'm sure that they get that these jokes had a truth behind it. My question is: are there ethical reasons not to do so? My point is, if I can't resource to my students' conscience to be honest, then I can't resort to anything, since I can't possibly outsmart 75 or so students every time I'm applying an exam if they want to be creative at cheating.