We study deadline-aware scheduling with adaptive network coding (NC) for real-time traffic over a single-hop wireless network. To meet hard deadlines of real-time traffic, the block size for NC is adapted based on the remaining time to the deadline so as to strike a balance between maximizing the throughput and minimizing the risk that the entire block of coded packets may not be decodable by the deadline. This sequential block size adaptation problem is then cast as a finite-horizon Markov decision process. One interesting finding is that the optimal block size and its corresponding action space monotonically decrease as the deadline approaches, and that the optimal block size is bounded by the greedy block size. These unique structures make it possible to significantly narrow down the search space of dynamic programming, building on which we develop a monotonicity-based backward induction algorithm (MBIA) that can find the optimal block size in polynomial time. Furthermore, a joint real-time scheduling and channel learning scheme with adaptive NC is developed to adapt to channel dynamics in a mobile network environment. Then, we generalize the analysis to multiple flows with hard deadlines and long-term delivery ratio constraints. We devise a low-complexity online scheduling algorithm integrated with the MBIA, and then establish its asymptotical utility optimality. The analysis and simulation results are corroborated by high-fidelity wireless emulation tests, where actual radio transmissions over emulated channels are performed to demonstrate the feasibility of the MBIA in finding the optimal block size in real time.