The cold start emissions from gasoline fuelled vehicles are a major challenge when meeting vehicle emissions regulation. Vehicle manufacturers therefore undertake extensive design and testing of the entire exhaust and engine control systems, which is both time consuming and costly. This is particularly an issue with the growing number of control parameters in modern powertrains.This paper presents a methodology that integrates appropriate physics-based models of the engine and aftertreatment into a numerical optimisation scheme, and is proposed as a possible means of reducing this calibration effort. The methodology is demonstrated over a prescribed drive cycle by identifying the optimal spark timing trajectory that maximises fuel economy while meeting emissions constraints. The trends in the resulting control policy are explained and the results are validated where possible.