Set Up a Persistent Wi‑Fi Direct Group on Android (No Root)

12 min read Learn how to create a permanent Wi‑Fi Direct group on Android using ADB, enabling reliable file sharing between devices without third‑party apps. October 04, 2026 08:00 How to Set Up a Persistent Wi‑Fi Direct Group on Android for Seamless File Sharing (No Root)

Wi‑Fi Direct lets two Android devices communicate directly over Wi‑Fi without a router. By default the group created for a transfer disappears as soon as the session ends, which means you have to recreate it each time you want to share files. This tutorial shows you how to make that group persistent using only ADB commands – no rooting, no extra apps, and no constant re‑pairing.

Before you start

  • Device requirements: Android 6.0 (Marshmallow) or newer, with Wi‑Fi Direct support (most modern phones have it).
  • Computer: Windows, macOS, or Linux with the Android SDK Platform‑Tools installed.
  • USB cable: Use a good quality data cable and keep the phone charged above 50 %.
  • Permissions: You must enable Developer options and turn on USB debugging on the phone.

Step 1 – Enable Developer options and USB debugging

  1. Open Settings → About phone.
  2. Tap Build number seven times until you see the message “You are now a developer”.
  3. Return to the main Settings page and open System → Developer options (the path may differ on Samsung – Settings → Developer options directly).
  4. Toggle USB debugging on and confirm the prompt.

Why this matters: ADB needs the debugging flag to accept commands from your PC. Without it the device will ignore every adb request.

Step 2 – Install and verify ADB on your computer

  1. Download the Platform‑Tools zip for your OS.
  2. Extract the folder to a convenient location (e.g., C:\adb or ~/adb).
  3. Open a terminal / command prompt and navigate to the extracted folder.
  4. Run adb version – you should see something like Android Debug Bridge version 1.0.41.

If the command is not recognized, add the folder to your system PATH or always run it from the folder directly.

Step 3 – Connect the phone and confirm the link

  1. Connect the phone to the PC with the USB cable.
  2. On the phone, you may see a prompt “Allow USB debugging?”. Tap Allow. You can also tick “Always allow from this computer” to avoid future prompts.
  3. In the terminal, execute adb devices. The output should list a device serial number followed by device.
    List of devices attached
    0123456789ABCDEF    device

If the device shows as unauthorized, re‑grant the permission on the phone.

Step 4 – Create a Wi‑Fi Direct group via ADB

Android provides a hidden cmd wifi interface that can start a Wi‑Fi Direct group. The command works on stock Android and on most OEM skins, though the exact syntax may vary slightly between versions.

  1. Run the following command to start a group and make the device the group owner (GO):
    adb shell cmd wifi p2p create-group
  2. If the command succeeds you will see no output, but the group is now active. To confirm, run:
    adb shell dumpsys wifi_p2p
    Look for a line similar to Group Owner: true and an SSID like DIRECT-xx-MyPhone.

Why we use the cmd wifi p2p interface: It bypasses the UI and creates the group directly, which is necessary for persisting the group later.

Step 5 – Make the group persistent across reboots

Android stores the persistence flag in the global settings database. Setting this flag tells the Wi‑Fi stack to keep the group alive after a reboot.

  1. Enable persistence with the following command:
    adb shell settings put global wifi_p2p_persistent 1
  2. Optionally, you can give the group a custom SSID and passphrase so you don’t have to remember the auto‑generated one:
    adb shell settings put global wifi_p2p_ssid "MyDirectGroup"
    adb shell settings put global wifi_p2p_passphrase "StrongPass123"
    These keys are read the next time the system restores the group.
  3. Reboot the device to test persistence:
    adb reboot
  4. After the phone boots, run adb shell dumpsys wifi_p2p again. You should still see the group listed and the SSID you set.

Note: Some OEMs (e.g., certain Xiaomi or Huawei ROMs) disable the global setting for security reasons. If the group disappears after reboot, the device simply does not support persistent groups without rooting.

Step 6 – Share files using the persistent group

With the group running, any Android device that supports Wi‑Fi Direct can join it. The built‑in file manager makes the process straightforward.

  1. On the second device, open Settings → Connections → Wi‑Fi Direct (the exact path may differ).
  2. Tap the SSID you set in Step 5 (e.g., MyDirectGroup) and enter the passphrase if prompted.
  3. Once the devices are connected, open the file manager on the primary device, select the files you want to share, tap the Share icon, and choose Wi‑Fi Direct as the target.
  4. The receiving device will show a transfer dialog; accept it to start the copy.

Because the group is persistent, you can repeat step 6 any time without recreating the group.

Alternative ways to start the group (if Step 4 fails)

  • Launch the system UI: adb shell am start -n com.android.settings/.wifi.p2p.WifiP2pSettingsActivity opens the Wi‑Fi Direct settings screen. From there you can manually tap “Create group”. The persistence flag set in Step 5 will keep the group alive after you leave the screen.
  • Use the broadcast intent: adb shell am broadcast -a android.net.wifi.p2p.action.CREATE_GROUP triggers the same internal service. Some custom ROMs listen for this broadcast while others ignore it.

Common troubleshooting scenarios

Problem: The group disappears after a reboot.

Cause: The device’s firmware disables the wifi_p2p_persistent setting.

Solution: Verify the setting after reboot with adb shell settings get global wifi_p2p_persistent. If it returns 0, the ROM blocks persistence. In that case you can keep the group alive by launching a tiny background script that re‑creates it on boot (requires a Tasker profile, which is beyond the scope of a no‑root tutorial).

Problem: The second device cannot see the group.

Cause: Wi‑Fi Direct on some devices defaults to the 5 GHz band, while older devices only support 2.4 GHz.

Solution: Force the group to use 2.4 GHz by adding the setting:

adb shell settings put global wifi_p2p_band 2
Re‑create the group after applying the change.

Security warning: A persistent Wi‑Fi Direct group behaves like an always‑on hotspot. Anyone within range who knows the SSID and passphrase can connect. Choose a strong passphrase and avoid using the default “direct‑xxxx” SSID in public places.

Verification checklist

  • Run adb shell dumpsys wifi_p2p – the group should be listed with persistent: true.
  • Reboot the device – the group should still appear in the Wi‑Fi Direct settings without manual recreation.
  • From another Android device, connect to the SSID and confirm you can browse the shared files.

When to avoid a persistent group

If you travel frequently and use public Wi‑Fi, keeping a permanent Wi‑Fi Direct hotspot can expose your device to unwanted connections. In such cases, create a temporary group only when you need to transfer files and delete it afterward with adb shell cmd wifi p2p delete-group.

Wrap‑up

By following the steps above you have turned your Android phone into a stable Wi‑Fi Direct hub that survives reboots, letting you share files instantly with any compatible device. The method relies only on ADB, works on stock Android, and leaves your device unrooted, preserving warranty and security.

Remember to keep the SSID and passphrase private, and revisit the persistence flag after major OS updates – manufacturers sometimes reset hidden settings. With a persistent group in place, file‑sharing becomes a frictionless part of your daily workflow.

User Comments (0)

Add Comment
We'll never share your email with anyone else.