It's so obvious the filming locations were California with the large expanse of desert/chaparral type land, but it seemed more like North or South Carolina with the mentality. I think there's one scene where they're in formation running and Stitch says they're going to invade South Carolina, or something like that.
I believe the majority was filmed at Camp Pendleton....a lot of the rifle range and ICS training was done at San Clemente which is the northern half of the base...some of the movie was filmed at the Base Brig, some at 22 Area which is next to the brig....and the scene where Gunny Highway salutes the flag as taps is played was filmed at Main Side.....I was stationed there for 4 years and was on the set at the brig when the drunk tank scene was filmed.
The assault scenes (not featuring the primary cast, just the military dog & pony) were filmed during a II MEF cruise doing an exercise in Puerto Rico. During the actual invasion of Grenada, the amphibious tractors did not launch until a few days after the initial assault due to tidal conditions. The film was set at Camp Lejeune, but was filmed aboard Camp Pendleton and the Oceanside/Carlsbad area, because it was cheaper to send a crew 70 miles down I5 vice sending them across the country. Besides, Camp Lejeune and Jacksonville suck, compared to Pendleton.
I laughed out loud in the theater in 1986 when Clint got off the bus in his Alphas where the antique tank park was near Mainside. There was nowhere he could be going because there was nothing there. Just going for a walk in his Alphas I guess!