I got bugged by always losing my tiles whenever Samsung felt like it, so cobbled together a quick Windows bat script which seems to work for me (based on data in https://www.xda-developers.com/how-...ttings-tile-toggle-on-samsung-galaxy-devices/). Can't see how to add attachments (maybe my account is too new?) so I'll post it below. Basically it queries the current tiles, adds MobileData and Hotspot if needed, then sends them back to the phone.
If you want the one line version, it's
adb.exe shell settings put secure sysui_qs_tiles "$(settings get secure sysui_qs_tiles),MobileData,Hotspot"
(not sure what happens if this is run when the tiles already exist)
And the full script, which only adds them if needed. Have tested on my Note 8, obviously take scripts posted by strangers with a grain of salt and only run it if you know what you're doing!
Edit early July 2019: looks like the June 2019 update may have broken compatibility with this. sysui_qs_tiles is always returning as null. Running the script won't hurt, but also won't help (you'll end up with "null,MobileData,Hotspot"). Still looking for a solution.
Edit late July 2019: the July 2019 update fixed it, the script works again.
@echo off
REM script to restore "MobileData" and "Hotspot" icons to cell phones
REM relies on ADB being installed
REM set the path to adb below (ANDROID_HOME / ADB_PATH)
REM enable ! - allows variables to be evaluated inside blocks
setlocal EnableDelayedExpansion
REM set the path that contains adb.exe here
set ANDROID_HOME=%localappdata%\Android\sdk\platform-tools
set ADB_PATH=%ANDROID_HOME%\adb.exe
if not exist %ADB_PATH% (
echo unable to find adb.exe in %ANDROID_HOME%
echo please set ANDROID_HOME in the file and retry
exit
)
REM count how many devices are attached
set "DEVICE_COUNT=0"
for /f "delims=" %%i in ('"%ADB_PATH% devices"') do (
set /a DEVICE_COUNT+=1
)
REM count 1 = "List of attached devices"
REM count 2 = "{GUID} device"
if %DEVICE_COUNT% lss 2 (
echo no attached device found
pause >nul
exit
)
if %DEVICE_COUNT% gtr 2 (
echo too many devices attached
pause >nul
exit
)
REM query the current active TILES
set TILES=
for /f "delims=" %%i in ('%ADB_PATH% shell settings get secure sysui_qs_tiles') do (
set TILES=%%i
)
if "%TILES%" EQU "" (
echo no current tiles found
pause >nul
exit
)
REM echo current tiles: %TILES%
REM build up the string that will contain the titles we want to add
REM doing it this way rather than adding to TILES avoids issues when TILES contains brackets
SET NEWTILES=
REM if MobileData and Hotspot not found, add them
set CHANGED=0
echo.%TILES% | findstr /C:"MobileData" 1>nul
if errorlevel 1 (
echo MobileData not found - adding it
set CHANGED=1
SET NEWTILES=!NEWTILES!,MobileData
) ELSE (
echo MobileData already found - not adding it
)
echo."%TILES%" | findstr /C:"Hotspot" 1>nul
if errorlevel 1 (
echo Hotspot not found - adding it
set CHANGED=1
SET NEWTILES=!NEWTILES!,Hotspot
) ELSE (
echo Hotspot already found - not adding it
)
REM send the new tiles to the device
if %CHANGED% EQU 1 (
%ADB_PATH% shell settings put secure sysui_qs_tiles "$(settings get secure sysui_qs_tiles),%NEWTILES%"
)
echo DONE
pause >nul
If you want the one line version, it's
adb.exe shell settings put secure sysui_qs_tiles "$(settings get secure sysui_qs_tiles),MobileData,Hotspot"
(not sure what happens if this is run when the tiles already exist)
And the full script, which only adds them if needed. Have tested on my Note 8, obviously take scripts posted by strangers with a grain of salt and only run it if you know what you're doing!
Edit early July 2019: looks like the June 2019 update may have broken compatibility with this. sysui_qs_tiles is always returning as null. Running the script won't hurt, but also won't help (you'll end up with "null,MobileData,Hotspot"). Still looking for a solution.
Edit late July 2019: the July 2019 update fixed it, the script works again.
@echo off
REM script to restore "MobileData" and "Hotspot" icons to cell phones
REM relies on ADB being installed
REM set the path to adb below (ANDROID_HOME / ADB_PATH)
REM enable ! - allows variables to be evaluated inside blocks
setlocal EnableDelayedExpansion
REM set the path that contains adb.exe here
set ANDROID_HOME=%localappdata%\Android\sdk\platform-tools
set ADB_PATH=%ANDROID_HOME%\adb.exe
if not exist %ADB_PATH% (
echo unable to find adb.exe in %ANDROID_HOME%
echo please set ANDROID_HOME in the file and retry
exit
)
REM count how many devices are attached
set "DEVICE_COUNT=0"
for /f "delims=" %%i in ('"%ADB_PATH% devices"') do (
set /a DEVICE_COUNT+=1
)
REM count 1 = "List of attached devices"
REM count 2 = "{GUID} device"
if %DEVICE_COUNT% lss 2 (
echo no attached device found
pause >nul
exit
)
if %DEVICE_COUNT% gtr 2 (
echo too many devices attached
pause >nul
exit
)
REM query the current active TILES
set TILES=
for /f "delims=" %%i in ('%ADB_PATH% shell settings get secure sysui_qs_tiles') do (
set TILES=%%i
)
if "%TILES%" EQU "" (
echo no current tiles found
pause >nul
exit
)
REM echo current tiles: %TILES%
REM build up the string that will contain the titles we want to add
REM doing it this way rather than adding to TILES avoids issues when TILES contains brackets
SET NEWTILES=
REM if MobileData and Hotspot not found, add them
set CHANGED=0
echo.%TILES% | findstr /C:"MobileData" 1>nul
if errorlevel 1 (
echo MobileData not found - adding it
set CHANGED=1
SET NEWTILES=!NEWTILES!,MobileData
) ELSE (
echo MobileData already found - not adding it
)
echo."%TILES%" | findstr /C:"Hotspot" 1>nul
if errorlevel 1 (
echo Hotspot not found - adding it
set CHANGED=1
SET NEWTILES=!NEWTILES!,Hotspot
) ELSE (
echo Hotspot already found - not adding it
)
REM send the new tiles to the device
if %CHANGED% EQU 1 (
%ADB_PATH% shell settings put secure sysui_qs_tiles "$(settings get secure sysui_qs_tiles),%NEWTILES%"
)
echo DONE
pause >nul
Last edited: