Simulate bad cell phone reception in the lab
Normally, the WWLAN testing and debug is done in electromagnetically shielded cages in labs when external tower signals (or local 3G-4G repeaters/re-translators) are too strong. The tests are usually done with special instruments like Agilent LTE tester, which has all abilities to change signal levels and simulate weak reception. In normal operation the LTE tester is connected in place of antenna on the Device Under Test (DUT), bypassing the DUT's own antennas. Alternatively, you can connect a simple onmidirectional antenna right to the LTE Tester output, and use the DUT natve antenna, but then you will need to control the distance and do re-calibration of the RF channel.

Keep in mind that the issue might be not in your software/firmware, but in HARDWARE. Wireless devices are normally using Automated Gain Control not only in receiver channel, but also in transmitter channel. When the reception is weak, the DUT rightfully will assume that it is far away from cell tower, and therefore MUST use higher transmit power. The power of transmission bursts can be up to 1-5 W, which will interfere with board layout, and if the PCB design is done poorly, it can disrupt all other DUT functionality, all other sensors, etc.