An on-the-fly unsteady adjoint-based aerodynamic and aeroacoustic optimization methodology is presented, aiming to achieve practical engineering applications to explore high-efficiency and low-noise design for aerodynamic shapes. Firstly, a novel on-the-fly hybrid CFD-CAA approach is developed with a close integration of unsteady Reynolds-averaged Navier–Stokes equations and a fully viscous time-domain FW-H formulation. Subsequently, an adjoint-based sensitivity analysis method is proposed for unsteady aerodynamic and aeroacoustic problems with either stationary or moving boundaries, wherein a unified architecture for discrete-adjoint sensitivity analysis of both aerodynamics and aeroacoustics is achieved by integrating the on-the-fly hybrid CFD-CAA approach. The on-the-fly approach facilitates direct evaluation of partial derivatives required for solving adjoint equations, eliminating the need for explicitly preprocessing flow and adjoint variables at all time levels in a standalone adjoint CAA solver and consequently substantially reducing memory consumption. The proposed optimization methodology is implemented within an open-source suite SU2. Results show that the proposed on-the-fly adjoint methodology is capable of achieving highly accurate sensitivity derivatives while significantly reducing memory requirements by an order of magnitude, and further demonstrations of single-objective and coupled aerodynamic and aeroacoustic optimizations highlight the potential of the proposed method in exploring high-efficiency and low-noise design for aerodynamic shapes.