How to set up link opening in Xiaomi apps: all ways

Have you ever encountered a situation where a link from a messenger or browser opens in an unexpected application? For example, instead of YouTube, a browser is launched, and instead of Telegram, a web version? On Xiaomi smartphones with a MIUI shell, this is a common problem associated with link processing settings. Unlike โ€œpureโ€ Android, there are nuances here, from hidden developer parameters to the features of working with Default Apps.

In this article, we will discuss all the current ways to link to the desired applications on Xiaomi, Redmi, Poco and Black Shark devices (including models from 2023-2026).

  • ๐Ÿ”ง Set up link opening through standard settings MIUI
  • ๐Ÿ“ฑ Use the developer parameters for binding
  • ๐ŸŒ Solve the problem with web links (HTTP/HTTPS) deep links
  • ๐Ÿ”„ Reset the opening settings if something goes wrong

We will pay special attention to the hidden limitations of MIUI 14, which block the change of link handlers for some system applications (for example, Mi Browser or Mi Video).

The problem with โ€œincorrectโ€ link opening on Xiaomi is usually due to three factors:

  1. Processor conflict: Android allows multiple applications to claim to handle the same type of link (e.g., youtube.com can open both the browser and the official YouTube app).
  2. Settings MIUI Xiaomiโ€™s shell aggressively promotes its services: video links can open in Mi Video and web pages can open in Mi Browser, even if you prefer Chrome or Firefox.
  3. Android cache errors: Sometimes the system forgets your choice of handler due to a crash in PackageManager or after updates.

Devices with MIUI 12-14 also have an โ€œApp Cloningโ€ mechanism that can duplicate link handlers, for example, if you have both the main Telegram and its clone installed, the system may be confused as to which one should open t.me links.

๐Ÿ“Š What version? MIUI you have installed?
MIUI 12
MIUI 13
MIUI 14
The other one/I don't know/

Method 1: Configure with โ€œDefault Appsโ€ in MIUI

The most obvious method is to use the built-in shell settings, which works for most applications other than system ones (e.g. Mi Browser or Mi Music, where Xiaomi limits changes).

Instructions:

  1. Open Settings โ†’ Applications โ†’ Applications by default.
  2. Select a category: ๐ŸŒ Browser for HTTP/HTTPS-reference ๐Ÿ“บ Player โ€“ for video and streaming services ๐Ÿ“ฑ Other applications - for messengers, social networks, etc.

Click on the current default application and select the one you want from the list.

โš ๏ธ Attention: B MIUI 14 some items may be blocked. For example, if you're trying to change your browser from Mi Browser to Chrome, the system can return the settings back after you reboot.

Make sure the right app is installed and updated

Close all background applications (especially browsers)

Check if there are duplicate applications (clones via Dual Apps)

Restart the device before setting up-->

Method 2: Using Developer Parameters

If standard settings donโ€™t help, turn on developer mode and force handlers to be assigned, especially for Xiaomi, where MIUI blocks changes to system applications.

Steps:

  1. Activate Developer Mode: Go to Settings โ†’ About Phone. Click 7 times on the MIUI Version until the notification "You've become a developer" appears.

Settings โ†’ Additional โ†’ For Developers

Forced link opening

WebView implementation

Select the desired application from the list.

For deep links (such as instagram:// or tg://), use the ADB command:

adb shell pm set-app-links --package com.example.app true

Where com.example.app is the batch name of the application (for example, org.telegram.messenger for Telegram).

How to find out the package name of the application?
Install the App Inspector app from Google Play or use the command: adb shell pm list packages | grep "app name" For example, for YouTube this will be com.google.android.youtube.

If the system ignores your settings or constantly asks which app to use, resetting the handlers cache will help, which will remove all saved preferences and force Android to re-query your choices.

How to reset:

  1. Go to Settings โ†’ Applications โ†’ All applications.
  2. Choose an app that handles links incorrectly (like Chrome or Mi Browser).
  3. Press Warehouse. โ†’ Clear the cache and Clear the data (โš ๏ธ This will remove all application settings, including bookmarks!).
  4. For a complete reset, run the command: adb shell pm clear-package-preferred-activities

After resetting the first time you open a link, the system will again ask which application to use. Choose the right one and mark Always.

๐Ÿ’ก

If the reset didnโ€™t work, try removing updates for system applications (such as Mi Browser) through Settings โ†’ Apps โ†’ Remove updates. This will bring the app back to the factory version, where link handlers may work differently.

Method 4: Manual editing of package.xml file (for advanced)

This method requires root rights and is designed for power users, and allows you to manually change the priorities of link handlers in the system file /data/system/package.xml.

Instructions:

  1. Get root access (for example, through Magisk).
  2. Use a root-enabled file manager (such as Root Explorer) and open the file: /data/system/package.xml
  3. Find a section with link handlers (look for <intent-filter> tags with android:scheme="http" or android:scheme="https").
  4. Change the priority (android:priority) for the desired application to a higher one (for example, from 100 to 1000).
  5. Save the file and restart the device.

โš ๏ธ Attention: Incorrect editing package.xml It can cause the system to crash or the inability to open any links!

AnnexPackage nameType of referenceDefault priority
Chromecom.android.chromeHTTP/HTTPS500
Mi Browsercom.android.browserHTTP/HTTPS1000
YouTubecom.google.android.youtubeyoutube://, https://youtu.be700
Telegramorg.telegram.messengertg://, https://t.me600

Solving problems with specific applications

Some applications require a separate approach, and let's look at the most common cases:

YouTube opens in the browser instead of the app

The problem arises from the conflict between youtube:// and https://youtube.com. Decision:

  1. Remove YouTube updates (if you have a beta version installed).
  2. Clear the cache and data of YouTube and the browser.
  3. In the developer settings, disable Forced Link Opening.

Often associated with duplicate handlers due to Dual Apps:

  1. Remove the Telegram clone (if any) in Settings โ†’ Dual Apps.
  2. Adb shell pm set-app-links --package org.telegram.messenger true

Also common is resetting after the MIUI update, to avoid this:

  1. Before updating, make a backup through Settings โ†’ About Phone โ†’ Backup.
  2. After the update, reassign link handlers (especially for browser and instant messengers).
Why do you reset your settings and re-open your links in Mi Browser?
This is due to Xiaomi's policy of forcibly returning system apps as default handlers.To avoid this: Disable the automatic Mi Browser update on Google Play. ADB-command to block the reset: adb shell pm disable-user --user 0 com.android.browser โš ๏ธ This may disrupt some system functions (e.g., previewing links in notifications).
How to get WhatsApp links to open in Chrome instead of Mi Browser?
WhatsApp uses its own link-opening mechanism that can ignore Android settings.Solution: On WhatsApp, go to โ‹ฎ โ†’ Settings โ†’ Data and storage โ†’ Open links outside WhatsApp. Select Chrome as your default browser. Clear WhatsApp cache and reboot your device.
Can I set up link opening separately for mobile internet and Wi-Fi?
No, Android doesn't support separate link handler settings depending on the type of network. However, you can: Use Tasker or MacroDroid to automatically switch your browser when you connect to a particular network, install two browsers and manually select the link you want when you open it (without the "Always" tick).
Why some deep links are used, for example, instagram://) not working?
This may be due to: No application (for example, you try to open an app). tiktok://, but TikTok is not installed. MIUI (Some deep links are forbidden by default.Outdated version of the app (update it to Google Play.)To unlock deep links: adb shell pm grant com.example.app android.permission.QUERY_ALL_PACKAGES Where com.example.app is the batch name of the application.
How to return the standard settings of link opening?
Follow the steps: Go to Settings โ†’ Applications โ†’ Default Apps and reset all settings. Clear the cache and data for Settings (com.android.settings) and Launcher (com.miui.home) apps. Follow the command: adb shell pm clear-package-preferred-activities After that, the system will re-request your choice when you first open the link.