Assigned to the 21st Infantry Regiment, McAndrew served initially in the western United States, and took part in the Ghost Dance War against the Sioux in 1890–1891. He was promoted to first lieutenant in 1894, and assigned to the 3rd Infantry. McAndrew served in Cuba during the Spanish–American War, and took part in the Battle of El Caney and the Siege of Santiago. In 1899, McAndrew was promoted to captain, and he served in the Philippines during the Philippine–American War. From 1905 to 1906, he served with the 3rd Infantry in Skagway, Alaska.