Anti-aircraft warfare
The results were sobering to an unexpected degree.
The United States was still emerging from the effects of the Great Depression and funds for the military had been sparse to the degree that 50% of shells used were still powder fused. The US Navy found that a significant portion of its shells were duds or low order detonations (incomplete detonation of the explosive contained by the shell). Virtually every major country involved in combat in World War II invested in aircraft development. The cost of aircraft research and development was small and the results could be large. So rapid was the performance leaps of evolving aircraft that the British High Angle Control System (HACS) was obsolete and designing a successor very difficult for the British establishment. Electronics would prove to be an enabler for effective anti-aircraft systems and both the US and UK had a growing electronics industry.
In 1939 radio controlled drones became available to actually test existing systems in British and American service. The results were disappointing by any measure. High-level manoeuvring drones were virtually immune to shipboard AA systems. The US drones could simulate dive bombing which showed the dire need for autocannons. Japan introduced powered gliders in 1940 as drones but apparently was unable to dive bomb. There is no evidence of other powers using drones in this application at all. It may have caused a major underestimation of the threat and an inflated view of their AA systems.

Second World War: Poland's AA defences were no match for the German attack, and the situation was similar in other European countries. Significant AAW (Anti-Air Warfare) started with the Battle of Britain in the summer of 1940. QF 3.7-inch AA guns provided the backbone of the ground-based AA defences, although initially significant numbers of QF 3-inch 20 cwt were also used. The Army's Anti-aircraft command, which was under operational command of RAF Fighter Command within Air Defence GB, grew to 12 AA divisions in three AA corps. Bofors 40 mm guns entered service in increasing numbers. In addition, the RAF regiment was formed in 1941 with responsibility for airfield air defence, eventually with Bofors 40 mm as their main armament. Fixed AA defences, using HAA and LAA, were established by the Army in key overseas places, notably Malta, Suez Canal and Singapore.
While the 3.7-inch was the main HAA gun in fixed defences and the only mobile HAA gun with the field army, the QF 4.5-inch gun, manned by artillery, was used in the vicinity of naval ports and made use of the naval ammunition supply. The 4.5-inch at Singapore had the first success in shooting down Japanese bombers. Mid war QF 5.25-inch naval guns started being emplaced in some permanent sites around London. This gun was also deployed in dual-role coast defence/AA positions.

Germany's high-altitude needs were originally going to be filled by a 75 mm gun from Krupp, designed in collaboration with their Swedish counterpart Bofors, but the specifications were later amended to require much higher performance. In response Krupp's engineers presented a new 88 mm design, the FlaK 36. First used in Spain during the Spanish Civil War, the gun proved to be one of the best anti-aircraft guns in the world, as well as particularly deadly against light, medium, and even early heavy tanks.
After the Dambusters raid in 1943 an entirely new system was developed that was required to knock down any low-flying aircraft with a single hit. The first attempt to produce such a system used a 50 mm gun, but this proved inaccurate and a new 55 mm gun replaced it. The system used a centralised control system including both search and targeting radar, which calculated the aim point for the guns after considering windage and ballistics, and then sent electrical commands to the guns, which used hydraulics to point themselves at high speeds. Operators simply fed the guns and selected the targets. This system, modern even by today's standards, was in late development when the war ended.

The British had already arranged licence building of the Bofors 40 mm, and introduced these into service. These had the power to knock down aircraft of any size, yet were light enough to be mobile and easily swung. The gun became so important to the British war effort that they even produced a movie, The Gun, that encouraged workers on the assembly line to work harder. The Imperial measurement production drawings the British had developed were supplied to the Americans who produced their own (unlicensed) copy of the 40 mm at the start of the war, moving to licensed production in mid-1941.

Service trials demonstrated another problem however: that ranging and tracking the new high-speed targets was almost impossible. At short range, the apparent target area is relatively large, the trajectory is flat and the time of flight is short, allowing to correct lead by watching the tracers. At long range, the aircraft remains in firing range for a long time, so the necessary calculations can, in theory, be done by slide rules—though, because small errors in distance cause large errors in shell fall height and detonation time, exact ranging is crucial. For the ranges and speeds that the Bofors worked at, neither answer was good enough.

The solution was automation, in the form of a mechanical computer, the Kerrison Predictor. Operators kept it pointed at the target, and the Predictor then calculated the proper aim point automatically and displayed it as a pointer mounted on the gun. The gun operators simply followed the pointer and loaded the shells. The Kerrison was fairly simple, but it pointed the way to future generations that incorporated radar, first for ranging and later for tracking. Similar predictor systems were introduced by Germany during the war, also adding radar ranging as the war progressed.

A plethora of anti-aircraft gun systems of smaller calibre was available to the German Wehrmacht combined forces, and among them the 1940-origin  Flakvierling quadruple-20 mm-autocannon-based anti-aircraft weapon system was one of the most often-seen weapons, seeing service on both land and sea. The similar Allied smaller-calibre air-defence weapons of the American forces were also quite capable. Their needs could cogently be met with smaller-calibre ordnance beyond using the usual singly-mounted M2 .50 caliber machine gun atop a tank's turret, as four of the ground-used "heavy barrel" (M2HB) guns were mounted together on the American Maxson M45 Quadmount weapon (as a direct answer to the Flakvierling), which were often mounted on the back of a half-track to form the M16 Multiple Gun Motor Carriage. Although of less power than Germany's 20 mm systems, the typical four or five combat batteries of an Army AAA battalion were often spread many kilometres apart from each other, rapidly attaching and detaching to larger ground combat units to provide welcome defence from enemy aircraft.

AAA battalions were also used to help suppress ground targets. Their larger 90 mm M3 gun would prove, as did the eighty-eight, to make an excellent anti-tank gun as well, and was widely used late in the war in this role. Also available to the Americans at the start of the war was the 120 mm M1 gun stratosphere gun, which was the most powerful AA gun with an impressive 60,000 ft (18 km) altitude capability, however no 120 M1 was ever fired at an enemy aircraft. The 90 mm and 120 mm guns continued to be used into the 1950s.
The United States Navy had also put some thought into the problem, When the US Navy began to rearm in 1939 in many ships the primary short ranged gun was the M2 .50 caliber machine gun. While effective in fighters at 300 to 400 yards this is point blank range in naval anti-aircraft ranges. Production of the Swiss Oerlikon 20 mm had already started to provide protection for the British and this was adopted in exchange for the M2 machine guns. From December 1941 to January 1942, production had risen to not only cover all British requirements but also allowed 812 units to be actually delivered to the US Navy. By the end of 1942 the 20 mm had accounted for 42% of all aircraft destroyed by the US Navy's shipboard AA. However, the King Board had noted that the balance was shifting towards the larger guns used by the fleet. The US Navy had intended to use the British pom-pom, however, the weapon required the use of cordite which BuOrd had found objectionable for US service. Further investigation revealed that US powders would not work in the pom-pom. Bureau of Ordnance was well aware of the Bofors 40 mm gun. The firm York Safe and Lock was negotiating with Bofors to attain the rights to the air-cooled version of the weapon. At the same time Henry Howard, an engineer, and businessman became aware of it and contacted RAMD W. R. Furlong, chief of the Bureau of Ordnance. He ordered the Bofors weapon system to be investigated. York Safe and Lock would be used as the contracting agent. The system had to be redesigned for both the English measurement system and mass production, as the original documents recommended hand fitting parts and drilling to shape. As early as 1928 the US Navy saw the need to replace the .50 caliber machine gun with something heavier.