Losing a phone is stressful enough without the added worry of not knowing who has it or where it is. An intruder-photo macro addresses that worry in a practical way: after a set number of failed unlock attempts, the phone quietly takes a photo with the front camera and emails it, along with the phone’s location, to an address you control. You do not need to be near the phone to receive that information, and the person holding the phone does not need to cooperate for it to work. It is a safety net, not a guarantee of recovery, but it is a safety net that has helped many people locate a misplaced phone or give useful information to the authorities after a theft.
It is important to be clear about the limits and the responsibilities here. This macro should only be installed on your own phone, and the email should only go to an address you control. Using it on someone else’s phone without their knowledge would be a serious privacy violation, and this guide does not support that. The macro also depends on the phone having battery, signal, and location services available at the moment it triggers, which cannot be guaranteed if a thief switches the phone off or removes the SIM. Think of it as one layer of protection, alongside a lock screen, a device-finding service, and a habit of backing up your data, not as a replacement for any of them.
With those boundaries in place, the setup itself is straightforward. It uses a failed-unlock trigger, a camera action, a location action, and an email action, linked together with a few safeguards to prevent false alarms from your own mistyped PINs.
Prerequisites
You need MacroDroid, a phone with a front camera, and an email account you can access from another device. The email account used for sending should be one you control and can check quickly, because a location email is only useful if you see it promptly. You also need location services enabled on the phone, and MacroDroid needs permission to access location, camera, and email or messaging, depending on how the email action is implemented on your device. Grant these permissions during setup, in a calm moment, not after a phone has already gone missing.
Decide on the failed-attempt threshold before you build. Three failed attempts is a common choice: it is low enough to catch a genuine intruder quickly, but high enough that your own occasional mistyped PIN, or a child playing with the phone, does not trigger a false alarm every week. Five attempts is a more forgiving alternative if you frequently mistype your PIN or pattern. Choose a number that matches your own habits, and write it down, because you will encode it in the trigger or in a counter variable.
Decide also where photos will be stored. The macro should save the photo to a folder on the phone and attach it to the email, rather than only saving it locally, because a photo that stays only on a stolen phone helps no one. If your email provider limits attachment sizes, check that a front-camera photo fits comfortably within that limit, or configure the camera action to use a moderate resolution rather than the maximum.
Finally, think about what the email should contain. At minimum, it should say that failed unlock attempts were detected, give the date and time, include the photo, and include a location link or coordinates. A clear subject line, such as “Intruder alert: failed unlock attempts on your phone”, helps you spot it quickly in a crowded inbox.
Step-by-Step Setup
Step 1: Create the failed-unlock detection macro
Create a new macro named “Intruder Alert”. For the trigger, use a Failed Unlock Attempts trigger if your device and MacroDroid version support it, set to your chosen threshold, such as three attempts. If a dedicated trigger is not available, you can approximate it with a combination of screen-unlock events and a counter variable that increments on each failed attempt and resets on a successful unlock. The dedicated trigger is preferable because it is more reliable, but the counter approach works as a fallback and is worth knowing about.
Test the trigger carefully, because it is the foundation of the whole system. Deliberately enter a wrong PIN the threshold number of times on your own phone, in a safe setting, and confirm the macro fires. Then unlock successfully and confirm it does not fire again immediately. This test also teaches you what a false alarm feels like, which helps you choose a threshold you can live with.
Step 2: Take a front-camera photo discreetly
Add a Take Photo action using the front camera as the first action after the trigger. Configure it to save the photo to a known folder with a timestamped filename, so each alert produces a distinct file rather than overwriting the previous one. Avoid any action that plays a shutter sound or shows a camera preview, if your device allows silent capture, because a visible or audible capture alerts the person holding the phone and may lead them to switch it off. Discretion is not about deception in a general sense; it is about giving the safety net a chance to work before the phone is disabled.
If your device cannot capture silently, accept that limitation and focus on speed: the faster the photo and email are sent after the trigger, the more useful they are. A photo taken openly is still better than no photo, and the location email alone is valuable even if the photo step is imperfect.
Step 3: Capture location and prepare the email
Add a Location action to obtain the phone’s current coordinates, and store them in variables. Follow it with a short wait, perhaps five seconds, to give location services time to produce an accurate fix, especially if the phone was indoors or had location off until that moment. Then add an Email action addressed to your own email address, with a clear subject line, a body that includes the date, time, and location coordinates or a map link, and the photo as an attachment.
Write the email body in plain language, because you may read it in a hurry under stress. A good template is: “Failed unlock attempts were detected on your phone at [time] on [date]. Location: [coordinates or map link]. A photo from the front camera is attached.” Avoid including sensitive information in the email that is not needed for recovery, such as passwords or account details, because email is not a secure channel for such information.
Step 4: Add safeguards against false alarms and loops
Add a constraint or a cooldown so the macro does not email you repeatedly if someone keeps trying to unlock the phone. A sensible cooldown is thirty minutes: after the first alert, further failed attempts within thirty minutes should not trigger another email, or should only update the log. Without a cooldown, a determined intruder, or a child playing with the phone, could flood your inbox with dozens of near-identical emails, which makes the useful first email harder to find.
Also add a reset condition: a successful unlock should reset the failed-attempt counter and cancel any pending alert, if your implementation uses a counter. This prevents a scenario where your own mistyped attempts in the morning combine with an intruder’s attempts later to trigger an alert that is partly your own doing. The system should distinguish, as far as possible, between your mistakes and someone else’s.
Step 5: Add a backup notification
As a backup to email, add a second action that sends the same information through another channel you control, if available, such as a message to a trusted family member’s number, or a notification to a second device. Email can be delayed by spam filters or poor signal, and a second channel increases the chance that at least one alert reaches you promptly. Keep the backup channel limited to people you trust, because it shares your phone’s location, which is sensitive information.
Testing and Verification
Test the full sequence on your own phone, in a controlled setting, by deliberately failing the unlock threshold number of times. Confirm each step: the photo is taken and saved, the location is captured, and the email arrives at your address with the photo attached and a usable location link. Open the photo and check it is recognisable: a front-camera photo taken at arm’s length in poor light may be blurry, and you should know that limitation in advance rather than discovering it during a real incident.
Test the cooldown by failing the unlock again within the cooldown period and confirming no second email arrives, or only a log entry is made, depending on your design. Test the reset by unlocking successfully and then failing again below the threshold, confirming no alert fires. Test also what happens with no signal: the macro should queue or retry the email when signal returns, or at least save the photo and location locally so they can be sent later. A macro that silently discards an alert because of a temporary signal loss is a safety net with a hole in it.
Finally, test from the receiving side. Read the email on another device, tap the location link, and confirm it opens a map at a plausible location. If the link does not work, fix the format now, because a location email with a broken link is frustrating at the exact moment you need it to work.
Troubleshooting
If no photo is taken, check camera permission and confirm the front camera is selected, not the rear camera, which would photograph the floor or a table. If no email arrives, check the email action configuration, check spam and junk folders, and check signal at the time of the test. If the location is wrong or missing, check location permission and the wait time before capturing: a location captured too quickly may be a stale last-known location rather than a current fix.
If false alarms occur frequently, raise the failed-attempt threshold from three to five, and check whether a particular situation, such as a child playing with the phone or a faulty screen protector causing mistyped patterns, is responsible. If alerts flood your inbox, the cooldown is missing or too short; lengthen it to thirty minutes or an hour. If the macro fires but the photo is black, the camera may have been covered or the phone may have been face down; that is a physical limitation, not a macro bug, and the location email remains useful even when the photo is not.
Tips and Responsible Use
Install this macro only on your own phone, send alerts only to addresses you control, and tell a trusted person that the system exists, so someone else can act on an alert if you cannot. Combine it with your phone manufacturer’s device-finding service, which can lock, locate, or erase the phone remotely, because an intruder photo is information, while remote lock and erase are actions. Keep your phone’s software updated, use a strong lock screen, and back up your data regularly, so losing a phone is an inconvenience rather than a catastrophe.
An intruder alert macro does not prevent theft, and it does not guarantee recovery. What it does is give you, in the first minutes after a phone is taken or misplaced, a photo and a location that you would otherwise not have. Built carefully, tested honestly, and used only on your own device, it is a proportionate, practical layer of protection that costs nothing to run and may prove invaluable on the one day you need it.
Frequently Asked Questions
Is it legal to take a photo of someone trying to unlock my phone?
On your own phone, for your own security, this is generally accepted as a security feature, similar to those built into many device-finding services. Do not install such a macro on someone else’s phone without their knowledge and consent.
What if the thief switches the phone off immediately?
The macro needs power and signal to send an email. If the phone is switched off before the threshold is reached, no alert will be sent. This is why the macro is one layer among several, including remote lock and device finding.
Will the photo be clear enough to identify someone?
It depends on lighting, distance, and camera quality. Front-camera photos in good light are usually recognisable; in poor light they may be blurry. The location information is valuable even when the photo is imperfect.
Can I use this if I often mistype my own PIN?
Yes, but raise the threshold to five attempts and use a cooldown, so your own mistakes do not trigger frequent false alarms. Test with your own mistyping pattern before relying on it.
Should I share the alert with anyone else?
Only with a trusted person, and only if you have agreed that in advance, because the alert contains your phone’s location, which is sensitive information.


