Rationale: The characterization of microbubble activity has proven critical in assessing the safety and efficacy of ultrasound-mediated blood-brain barrier (BBB) opening and drug and gene delivery. In this study, we build upon our previous work on theranostic ultrasound (ThUS)-mediated BBB opening (ThUS-BBBO) and conduct for the first time a comprehensive characterization of the role of microbubble cavitation in ThUS-BBBO, as well as its impact on gene delivery with adeno-associated viruses (AAV). Methods: A repurposed imaging phased array was used throughout the study to generate focused transmits and record microbubble activity through high-resolution power cavitation imaging (PCI). The cavitation of microbubbles under ThUS pulses was first characterized in flow phantom using pulse lengths ranging from 1.5 to 20 cycles and under varying microbubble flow rates using a separate single-element transducer a passive cavitation detector (PCD). A comprehensive in vivo study in mice was then conducted to characterize the in vivo microbubble activity under ThUS and correlate the resulting cavitation with AAV-mediated transgene delivery and expression. The transcranial microbubble activity was first detected in two mice using a PCD, to confirm the findings of the flow phantom study. Next, three mouse studies were conducted to evaluate the relationship between cavitation and AAV delivery; one with three different microbubble size distributions using polydisperse and size-isolated microbubbles, one with variable burst length and burst repetition frequency, and one with different AAV serotypes and injection doses. Electronic beam steering was used to induce bilateral BBB opening with 1.5 cycle on the left and 10 cycles on the right hemisphere. Cavitation dose was correlated with BBB opening volume, AAV transgene expression was evaluated with immunofluorescence staining and histological safety was assessed with T2* imaging and Hematoxylin and Eosin staining. Results: Frequency domain analysis in the phantoms revealed a broadband-cavitation dominance at the shorter pulse lengths, while harmonic cavitation components are significantly increased for longer pulses. The PCD was better at detecting higher frequency harmonics, while the signal received by the theranostic array was more broadband dominated. Analysis of signals in the time domain showed that the longer pulses induce higher microbubble collapse compared to short pulses. In the transcranial in vivo experiments, the PCD was able to detect increased harmonic cavitation for 10-cycle pulses. The microbubble study showed that 3-5 m microbubbles resulted in the largest cavitation doses, BBBO volumes and AAV transgene expression compared to the smaller microbubble sizes. The burst sequence study revealed that the sequences with shorter bursts and faster burst repetition frequencies induce larger BBBO volumes and AAV transduction due to faster microbubble replenishment in the focal volume. Increased erythrocyte extravasation was observed on the hemisphere sonicated with 10-cycle pulses. Transgene expression was also increased with injection dose, without notable side effects during the three-week survival period. Finally, AAV9 was shown to be the serotype with the highest transduction efficiency compared to AAV2 and AAV5 at the same injected dose. Conclusions: This is the first comprehensive study into the microbubble cavitation under theranostic ultrasound. The phantom and in vivo studies show that the mechanism of ThUS-BBBO is mainly transient cavitation dominant, as microbubble collapse increases with pulse length despite the increased harmonic frequency response. Increased cavitation dose resulted in larger BBBO volumes and transgene expression in vivo. While ThUS induced microhemorrhage for most of the studied conditions, it did not have an impact on the survival and behavior of the mice.