An air compressor includes a piston slidably received in a cylinder housing, and a motor coupled to the piston for moving the piston relative to the cylinder housing in a reciprocating action, in order to generate pressurized air. A cover is detachably secured on top of the cylinder housing, and includes an outlet tube having a compartment communicating with the cylinder housing, for receiving pressurized air from the cylinder housing, and includes an inlet blocked by a check valve device. The cover may be adjusted and secured to the cylinder housing, to adjust the inlet to different position relative to the cylinder housing, and to prevent the inlet from being blocked by objects.