General Hugh Mercer organized the Flying Camp, and selected Colonel McAllister to command the Second Pennsylvania Regiment.

This command was soon engaged in and about New York City and Staten Island. A short time later Colonel McAllister led the regiment in the defense of Fort Washington, where a large number of them were taken prisoners, among them being two of his captains.

In the campaign of 1776 Colonel McAllister was present with his regiment, under General James Ewing, when Washington captured the Hessians in Trenton on Christmas night.

After the expiration of his term of service in the Flying Camp, in 1777, Colonel McAllister returned to his home at Hanover, and in March of this year he was elected by the General Assembly, county lieutenant.

In the discharge of this commission he recruited six different battalions of militia in York County, which then included the present Adams County.

He drilled and disciplined the troops and made them ready for the service in the field when they were required to defend the State against the invasion of the British foe.

On August 28, 1777, Colonel McAllister wrote to President Wharton that there were dissensions among the Associators in the German townships near Hanover. Two hundred freemen had assembled at one place for the purpose of opposing the draft of the militia for service in the field.

He continued by saying that he had lived in peace among these people for twenty years or more, and knew well their customs and habits, but it was very difficult to induce them to take up arms against the country to which they had sworn allegiance.

He said that notwithstanding the difficulties he had encountered in the prosecution of his duties as lieutenant of York County, he had marched five companies to the front fully armed and equipped, and would soon have three more ready to take up the march for the main army.

Nearly every man recruited was a substitute, which had obtained by Colonel McAllister.