Activate Android Alarm with ADB?
March 28, 2020 7:32 AM   Subscribe

I have an old Android phone that I use for dirty jobs, like taking pictures of motorcycle internals while I'm disassembling things. Unfortunately, I put it down somewhere, and can't find it. It doesn't have a SIM card, so I can't call it.

However! The phone has a giant battery, and I had also configured it to accept ADB connections over the network. So it's still turned on, and still pingable (must be near enough to my WiFi). I can connect to it with ADB and get a shell.

So if there was some way *FROM ADB* to turn on a ringtone or make it play a sound, I'd have a shot at finding it.

Is there a way?
posted by spacewrench to Computers & Internet (5 answers total)
 
Best answer: You can try to start to play a music file, this works on one of my test devices even if it is locked:

adb push t.mp3 /sdcard/
adb shell am start -a android.intent.action.VIEW -d file:///sdcard/t.mp3 -t audio/mp3

(Playing a video file the same way or starting youtube (adb shell am start -a android.intent.action.VIEW -d https://www.youtube.com/watch\?v\=oVQqmH4ufCQ)) will not produce any sound if the device is locked it seems like)

You could also use scrcpy to control the device remotely and start a alarm or similar, works fine over ADB.
posted by rpn at 8:12 AM on March 28, 2020 [1 favorite]


Best answer: Are you logged into Google on the device? It looks like find my device works for devices that don't have sim cards. (It just located my tablet that does not have a sim card.
posted by dforemsky at 8:30 AM on March 28, 2020


Response by poster: Perfect, thanks!

After posting this question, I found a couple of remote-screen programs, including scrcpy, but they didn't work for me. Scrcpy seemed to get a good starting screenshot, but it wasn't able to send input capable of breaking out of screen-off / sleep mode. Once I found the phone, I played with scrcpy more, and it works if the phone screen is on. I'm waiting for the screen sleep to kick in now, to see whether scrcpy can wake it up.

The phone is running LineageOS and I had used a throwaway Google account during the startup provisioning process, but Google was able to connect that to me and to all my other devices (!), even ones that are associated with other Google addresses (!!). So Find My Device also works / would have worked. (I knew Google had its tentacles everywhere, but this is more invasive than I had realized.)
posted by spacewrench at 8:35 AM on March 28, 2020 [2 favorites]


FWIW, Google is a bit insane with the way logins work on Android. Logging in to the Gmail app or Maps or Calendar or anything else will add that Google account to your phone until you remove it in the settings app. I'd be interested to know if you are certain you never logged in to any Google services with anything but the throwaway account on that phone because that would be new to me..
posted by wierdo at 11:01 AM on March 28, 2020


adb shell input keyevent KEYCODE_WAKE

adb shell input keyevent KEYCODE_POWER

and if your device is API>=20

adb shell input keyevent KEYCODE_WAKEUP
posted by MacD at 3:12 AM on March 31, 2020


« Older How to encourage a relative stranger   |   How to host an online pub quiz for self-isolating... Newer »
This thread is closed to new comments.