well since this is arfcom anything but an AR for HD is by definition heresy.
My personal opinion is that almost any firearm is suitable at apartment ranges and almost any firearm is unsuitable at apartment ranges. Any thing that does the job on an intruder at a few yards range is also probably also going to have an over-penetration problem on apartment walls if you miss.
When we lived in an apartment, the 1911 was weapon of choice, but the 870 was also available. Shotties (and ARs) are clumsy in close quarters. I personally would got for a pistol in a caliber starting with a .4. But I wouldn't mind using a shottie with small shot. At that range a small shot will penetrate adequately, and for those that say it doesn't open up enough, that's fine it's still the same with a rifle, you still have to make the same hit in the same area. If you like put a slug or buck round behind it, if the small shot doesn't do the job. Small shot doesn't endanger the neighbors like just about any rifle or pistol round would.
I personally don't have my AR set up or available for HD. If the target is too far out for the shotgun or pistol, then it's almost certainly not a legal target. I used to shoot Cowboy Action, and in those days, my Model 92 clone in 45 Colt was my go to HD gun, but I also shot it a lot.
Contrary to what you might hear. The CA laws on HD are liberal in a good way.
197. Homicide is also justifiable when committed by any person in any of the following cases:
1. When resisting any attempt to murder any person, or to commit a felony, or to do some great bodily injury upon any person; or,
2. When committed in defense of habitation, property, or person, against one who manifestly intends or endeavors, by violence or surprise, to commit a felony, or against one who manifestly intends and endeavors, in a violent, riotous or tumultuous manner, to enter the habitation of another for the purpose of offering violence to any person therein; or,
3. When committed in the lawful defense of such person, or of a wife or husband, parent, child, master, mistress, or servant of such person, when there is reasonable ground to apprehend a design to commit a felony or to do some great bodily injury, and imminent danger of such design being accomplished; but such person, or the person in whose behalf the defense was made, if he was the assailant or engaged in mutual combat, must really and in good faith have endeavored to decline any further struggle before the homicide was committed; or,
4. When necessarily committed in attempting, by lawful ways and means, to apprehend any person for any felony committed, or in lawfully suppressing any riot, or in lawfully keeping and preserving the peace.
(Amended by Stats. 1963, Ch. 372.)
198. A bare fear of the commission of any of the offenses mentioned in subdivisions 2 and 3 of Section 197, to prevent which homicide may be lawfully committed, is not sufficient to justify it. But the circumstances must be sufficient to excite the fears of a reasonable person, and the party killing must have acted under the influence of such fears alone.
(Amended by Stats. 1987, Ch. 828, Sec. 8.)
198.5. Any person using force intended or likely to cause death or great bodily injury within his or her residence shall be presumed to have held a reasonable fear of imminent peril of death or great bodily injury to self, family, or a member of the household when that force is used against another person, not a member of the family or household, who unlawfully and forcibly enters or has unlawfully and forcibly entered the residence and the person using the force knew or had reason to believe that an unlawful and forcible entry occurred.
As used in this section, great bodily injury means a significant or substantial physical injury.
(Added by Stats. 1984, Ch. 1666, Sec. 1.)
199. The homicide appearing to be justifiable or excusable, the person indicted must, upon his trial, be fully acquitted and discharged.
(Enacted 1872.)