All of the devs in my office wear earphones when working and is usually a clear indicator that we're focused on something. We used to have an issue with the other departments coming to our area and breaking our concentration when we were in the middle of something, and we fixed that by establishing an office-wide rule to PM us instead.
This is what the devs do to get one another's attention as well. The only exception I have is for the dev I sit next to. Because of our proximity we usually ask one another to look over the code we are working on. We agreed that we can just lightly knock or tap the corner of each other's desk to get the other's attention instead of PMing.
There are other ways to get your coworker's attention besides invading her personal space. Our new designer will currently stand about 3 feet from my desk in my peripheral view and wave awkwardly until I'm at a stopping point. While that is not ideal, it is not as invasive and startling as someone pulling out my earphones or touching me unexpectedly.
You should discuss with her what would be the best way to get her attention instead of randomly trying stuff until something works. I think your current approach will just make her more and more uncomfortable. I also think that she would appreciate an apology as well. Wait till she's not working on something and try to talk to her about it.