Yesterday I felt the earthquake when the phone’s earthquake warned.
I don’t know how to make this sentence right or sounds better, but is it okay to use the word “warn” in this sentence to mean we get the earthquake warning from our cell phone when there’s an earthquake?
If you want to emphasize the timing of the message I would say " I got the earthquake warning yesterday right when it started" If you just want to make a general statement that you get an alert on your phone when there is an earthquake I would say “I get an alert on my phone when there is an earthquake”
“the phone’s earthquake” is not right. Perhaps your phone has an earthquake warning app. You could say “… when the phone’s earthquake app alerted” or “when the phone’s earthquake app went off”. You can use fewer words if it’s understood from context. E.g., “… when the earthquake app went off” or “…when the alert app sounded.” “Warned” as you used it is correct, but the examples I gave sound better in my midwest American opinion.