Dual-fuel combustion engines have shown the potential to extend the operating range of Homogeneous Charge Compression Ignition (HCCI) by using several combustion modes, e.g. Reactivity Controlled Compression Ignition (RCCI) at low/medium load, and Partially Premixed Compression Ignition (PCCI) at high load. In order to optimize the combustion mode operation, the respective sensitivity to the control inputs must be addressed. To this end, in this work the extremum seeking algorithm has been investigated. By definition, this technique allows to detect the control input authority over the system by perturbing its value by a known periodic signal. By analyzing the system response and calculating its gradient, the control input can be adjusted to reach optimal operation. This method has been applied to a dual-fuel engine under fully, highly and partially premixed conditions where the feedback information was provided by incylinder pressure and NOx sensors. The gasoline fraction and the injection timing were selected as control inputs and an extremum seeking controller was designed and verified to optimize brake efficiency by tracking the ideal combustion phasing and to reduce NOx emissions as well.