Here, we present a protocol to determine the preferred environmental temperature of Drosophila larvae using a continuous thermal gradient.