The SeaLeon, a 2.4-meter autonomous sailboat, crossed the Atlantic Ocean during the 2018 MicroTransat Challenge. To understand its behaviour in different sea conditions, and support the design of future autonomous sailboats, a Hardware-in-the-Loop (HIL) simulator was developed. The HIL simulator includes at its core the sailboat pilot on an embedded system. The sensor data input to the embedded system is fed by a navigation simulator that takes into account the different forces on the sailboat due to the wind, waves and current conditions. The HIL simulator can be tested for different past and future navigation routes. The tool was used to diagnose weaknesses in the SeaLeon autopilot algorithm. Overall, the HIL sailboat design provides a valuable tool for assessing and optimizing sailboat performance under specific environmental conditions, as well as for identifying weaknesses in the pilot algorithm. An interesting use of the HIL simulator is its potential to improve system design of a sailboat, such as hull geometry and sail dimensions.