On the 1790 outbreak of war with Tipu Sultan of Mysore, Hartley received command of a detachment sent to the coast of Cochin to aid the company's ally, the Rajah of Travancore.
In January 1791 Hartley advanced to Seringapatam now Srirangapatna, but the siege was eventually postponed, and the Bombay troops retired to Cannanore.