If you have two white and two black coming in (total of 4) and the smoke detectors is wired to those two sets of wires, then yes, take the smoke detector wires off, keep the pairs of black and white together by color and cap them off. If the smoke detector is just wired to one set of black and white wires, just remove the smoke detector and cap the ends of the two wires. In other words keep the black(s) and white(s) separate from each other but together by color. If the black and whites touch each other, sparks fly and the breaker pops (hopefully) - that’s a dead short.