The power must be turned off for the smoke alarm to work. The smoke alarm needs to be removed from the mounting brackets. You can remove the battery for a sealed-battery model. The test button needs to be held.
Let's Get It Fixed!
HomeX virtual experts will assess your issue (for free!) and can resolve simple problems.