The invention provides a coal seam outburst danger testing while drilling method and device. The coal seam outburst danger testing while drilling method and device are applicable to outburst danger predication, methane gas extraction and exploitation effect evaluation and the like. By drilling a coal seam and testing methane gas parameters while drilling, lithology and coal seam information while drilling in real time, a test while drilling and grounding of the coal seam outburst danger is achieved. The device comprises a cabin body, a pressure sensor, a temperature sensor, a flow sensor, an electromagnetism sensor, an ultrasonic wave sensor, a wave velocity testing module, a monitoring control module, a power source module and a communication module and is installed between a drill and an inclinometer while drilling or a first drill rod. In the period when the coal seam is drilled or drilling is stopped for replacing the drill, the gas pressure, the temperature, the flow speed, the coal body wave velocity, the electromagnetic radiation and an ultrasonic wave signal on a testing point can be monitored and recorded in real time, and the methane gas pressure, the methane gas content, the initial desorbed methane gas content, the medium lithology, the wave speed, the coal body stress and the coal seam outburst danger on the testing point are analyzed and calculated. The coal seam outburst danger testing while drilling method and device have the advantages of being free of sampling tests and achieving testing while drilling and grounding, multi-parameter synchronous comprehensive evaluation and the like.