Skip to main content

Automation

info

This article applies to AdGuard VPN for Android v2.18 or later. The automation feature is not available on Android TV.

Many people choose Android because they like customizing settings and want complete control over their devices. If you prefer not to toggle your VPN manually throughout the day, you can automate AdGuard VPN using third-party automation apps such as Tasker, MacroDroid, Automate, and similar tools.

The Automation feature enables AdGuard VPN to receive and execute control commands (called “intents”). By configuring tasks and profiles in your automation app, you can have AdGuard VPN adapt automatically to your daily routines — for example, connecting when you launch specific apps or join untrusted public Wi-Fi networks, switching locations based on a schedule, or disconnecting when you arrive home.

Automation *mobile_border

Prerequisites​

Before setting up automation rules, ensure the following requirements are met:

  1. You are logged into the app: AdGuard VPN requires an active account session to establish connections.
  2. VPN permissions are granted: Android must allow AdGuard VPN to establish a VPN tunnel. If you have just installed the app, open it and connect manually once to grant the necessary system permission.
  3. App notifications are enabled: Android suppresses toast messages (short pop-up messages) from apps running in the background if their notifications are disabled. Keeping notifications turned on ensures you see command execution feedback. The Automation screen in AdGuard VPN warns you if notifications are turned off.

Setting up automation in AdGuard VPN​

By default, automation is disabled, and AdGuard VPN silently ignores all incoming commands. To enable the feature, open AdGuard VPN and go to Settings → General → Advanced → Automation. You can turn on the feature directly on the Advanced settings screen or by using the toggle on the Automation screen.

Automation toggle *mobile_border

To prevent third-party apps from controlling your VPN without your knowledge, all commands are secured with a password. When you first install the app, AdGuard VPN generates a random 8-character password consisting of Latin letters and digits. The password is displayed in plain text on the Automation screen.

  • To change the password: Tap Password, enter a new password (at least 4 characters), and tap Save.
  • To copy the password: Tap the copy icon next to the password. This copies the formatted string password:<your_password>, which can be pasted directly into your automation app’s Extra field.
note

Passwords are case-sensitive. While all-numeric passwords are supported, automation apps like Tasker may pass purely numeric values as numbers rather than strings, which strips leading zeros (for example, 0123 becomes 123). To prevent authentication errors, do not use passwords that start with zero.

Required intent fields​

Every intent sent to AdGuard VPN must be addressed to the app’s broadcast receiver and contain the following fields:

FieldValue
Packagecom.adguard.vpn
Classcom.adguard.vpn.receivers.AutomationReceiver
Actionconnect or disconnect — see the Available actions section below
Extrapassword:<your_password>, plus optional parameters if needed

The Extra field holds key:value pairs. The password:<your_password> pair is mandatory; optional parameters are passed the same way. In Tasker, each pair is entered on its own line in the Extra field — see the example below.

note

Target: Broadcast Receiver is not an intent field — it is a field of the automation app’s UI (in Tasker, for example). AdGuard VPN listens for broadcasts, so the intent must be delivered to a broadcast receiver. If you set Target to Activity or Service instead, the command never reaches AdGuard VPN.

Available actions​

The Action field accepts two values.

connect​

Initiates a VPN connection. When sent without additional parameters, AdGuard VPN connects to the location currently selected in the app. To connect to a specific location, add the city:<CityName> parameter described in the Optional parameters section below.

disconnect​

Disconnects the current VPN session.

Optional parameters​

Optional parameters are extra key:value pairs passed in the same Extra field as the password.

city:<CityName>​

Connects to a specific server location. Use it together with the connect action, for example city:Frankfurt. If the VPN is already connected to another server, it will automatically reconnect to the specified city.

When specifying a city, keep in mind the following rules:

  1. Language and case matching: The city name is compared strictly and is case-sensitive. It must match the city name as displayed in the AdGuard VPN location list in the app’s current interface language (leading and trailing whitespace is trimmed). For example, if the location is listed as Frankfurt, passing frankfurt will fail. If you change the app interface language later, update your automation tasks accordingly.

    Localized names fall under the same rule: the name must match what the app displays in the current interface language. With a Polish interface the location appears as Warszawa, so passing city:Warsaw fails with No location found for this city — use city:Warszawa.

  2. Virtual locations: For virtual locations, specify only the city name without the(Virtual) tag. For example, if the list displays Mumbai (Virtual), use city:Mumbai.

  3. Location priority: If a city has both a standard and a virtual location, the standard location is selected. If multiple locations match the name, AdGuard VPN selects the server with the lowest ping.

  4. Subscription level: Attempting to connect to a premium location with a free account will fail and display an error toast message.

quiet:true​

By default, AdGuard VPN displays toast messages confirming actions or reporting errors. To suppress them, add the parameter quiet:true. Even when toasts are muted, Android system status notifications will still appear.

Example: Setting up automation in Tasker​

To create a task in Tasker that connects AdGuard VPN to Frankfurt:

  1. In the Tasker app, go to the Tasks tab and tap the + button to create a new task. Enter a name (for example, AdGuard VPN Connect) and tap the checkmark.

  2. Tap the + button at the bottom to add an action.

  3. Select System → Send Intent.

  4. Configure the intent fields:

    Action: connect
    Cat: None
    Mime Type: (leave empty)
    Data: (leave empty)
    Extra: password:<your_password>
    Extra: city:Frankfurt
    Extra: quiet:true
    Package: com.adguard.vpn
    Class: com.adguard.vpn.receivers.AutomationReceiver
    Target: Broadcast Receiver
  5. Tap the back button to save the action.

Intent fields *mobile_border

Once saved, link the task to any Tasker profile or trigger, such as launching an app, joining a Wi-Fi network, or reaching a specific time.

note

city:Frankfurt and quiet:true are optional — the task works with the password alone.

To set up a disconnect task, follow the same steps, but set Action to disconnect and omit the city parameter.

Troubleshooting and toast messages​

Because automation apps send intents in the background without built-in execution feedback, toast messages provide immediate visual cues when you test your tasks. They help you quickly pinpoint setup errors — such as misspelled city names, invalid passwords, or missing system permissions — before you silence notifications with quiet:true.

Toast messageDescription / Solution
Connecting… / Disconnecting…The command was accepted and is being executed. This message appears even if the VPN is already in the requested state.
Check the automation password and try againThe password parameter was missing, incorrect, or formatted improperly.
Couldn’t recognize the task from the Action fieldThe value in the Action field was missing or not recognized as connect or disconnect.
Log in to AdGuard VPN to connectYou are currently logged out. Open the app and sign in to your account.
Open AdGuard VPN and allow it to set up a VPN connectionAdGuard VPN lacks Android permission to set up a VPN tunnel. Open the app and connect manually once. If notifications are enabled, you will receive a notification instead.
Open AdGuard VPN to connectAndroid restricted the app from establishing a VPN connection in the background. Open the app manually. If notifications are enabled, you will receive a notification instead.
No location found for this cityThe city was not found. Verify the spelling, ensure correct capitalization, and make sure the name matches the app’s interface language.
This location is available only with a premium subscriptionThe requested server requires an active AdGuard VPN subscription.
Couldn’t load locations. Try again laterThe app failed to fetch the server list. Check your Internet connection and try reconnecting.