Bluetooth enabled and disabled

android enable disable bluetooth via command line

I am trying to enable disable bluetooth on android device using command line. I can enable it using adb shell am start -a android.bluetooth.adapter.action.REQUEST_ENABLE But it prompts user to ‘allow’ or ‘deny’. I also see there is option to launch ble settings first like adb shell am start -a android.settings.BLUETOOTH_SETTINGS and then enable disable adb shell input keyevent ** But it won’t be device independent.

10 Answers 10

Updated: 2023-03-10 — Android 12/13

Enable bluetooth via cmd

adb shell cmd bluetooth_manager enable 

Disable bluetooth cmd

adb shell cmd bluetooth_manager disable 

Updated: 2019-06-22: — Android 11

adb shell settings get global bluetooth_on adb shell settings list global |grep ^bluetooth_on 

Enable Bluetooth via settings

adb shell settings put global bluetooth_disabled_profiles 1 

Disable bluetooth settings

adb shell settings put global bluetooth_disabled_profiles 0 

Enable bluetooth via content

adb shell content insert \ --uri content://settings/global \ --bind name:s:bluetooth_disabled_profiles \ --bind value:s:1 --user 0 

Disable bluetooth content

adb shell content insert \ --uri content://settings/global \ --bind name:s:bluetooth_disabled_profiles \ --bind value:s:0 --user 0 

Android 11/12/13 and older versions

Enable Bluetooth

adb shell settings put global bluetooth_on 1 

Disable Bluetooth

adb shell settings put global bluetooth_on 0 

Enable bluetooth via activity manager

adb shell am broadcast \ -a android.intent.action.BLUETOOTH_ENABLE --ez state true 

Disable bluetooth via activity manager

adb shell am broadcast \ -a android.intent.action.BLUETOOTH_ENABLE --ez state false 

Enable/Disable bluetooth via keyevents

adb shell am start \ -a android.settings.BLUETOOTH_SETTINGS \ adb shell input keyevent 19 adb shell input keyevent 23 

On Huawei P30 Pro with Android P even your new solution doesn’t work. When I use adb shell settings put global bluetooth_disabled_profiles 1 , it disables bluetooth (as opposite to what you say) and adb shell settings put global bluetooth_disabled_profiles 0 does nothing, it doesn’t enable nor disable it.

See if they have changed the name so it might be bluetooth_on instead of bluetooth_disabled_profiles. If you type ‘adb shell settings list global|grep -i bluetooth’ you should get some alternatives what you can try if above dosn’t work so just change name and value if needed, above works fine on Huawei P9, Samsung S8 and Huawei P8 that’s all I have tried on with Android 8.0 & Android 9.0. Regards

Читайте также:  Toshiba satellite l655 bluetooth driver

for me, all of these methods from 2019 edit (both disable and enable) disable bluetooth for just a very quick amount of time. It rather looks like a reset. Samsung A50, Android 10 (kernel 4.14 )

adb shell settings put global bluetooth_on 0 worked for me in android 12.1 — but is there anyway that I can make it non-persistent so that behavior is same after each boot? When settings put global bluetooth_on 0 — it retains the value and next time I reboot, I notice that boot_completed never gets set to 1. Unless I wipe /data partition and restart again and re-put settings put global bluetooth_on 0 .

adb shell service call bluetooth_manager 6 
adb shell service call bluetooth_manager 8 

We are trying to enable and disable Bluetooth before we start our automation test using adb commands Enable adb shell service call bluetooth_manager 6 Disable adb shell service call bluetooth_manager 9 We are getting the Bluetooth status using this command adb shell settings get global bluetooth_on Are there any other work around to enable and disable the bluetooth using APPIUM java because these commands working in some devices but not in all the device. Any solution for this? The same commands working in Android 5 (Lollipop)

using static method codes as suggested here will never work across all devices. These codes can and do change on a per device basis depending on vendor and OEM modifications.

Источник

Enable or Disable Bluetooth in Windows 10

Bluetooth in Windows 10 lets you connect your device wirelessly to your PC, enabling file transfer without using any wires. For example, you can connect your Bluetooth devices such as printers, headphones, or mouse to your Windows 10 via Bluetooth. Now to save battery on your PC, you might want to disable Bluetooth communication on Windows 10.

Enable or Disable Bluetooth in Windows 10

Windows 10 allows you to disable Bluetooth using the Settings, but sometimes Bluetooth settings can be greyed out in which case you need to look for an alternate method to enable or disable Bluetooth. Anyway without wasting any time let’s see How to Enable or Disable Bluetooth in Windows 10 using the below-listed tutorial.

Enable or Disable Bluetooth in Windows 10

Make sure to create a restore point just in case something goes wrong.

Method 1: Enable or Disable Bluetooth in Action Center

1. Press Windows Key + A to open Action Center.

2. Now click on “Expand” to see more settings in the Action Center.

Click on Expand to see more settings in the Action Center | Enable or Disable Bluetooth in Windows 10

3. Next, click on Bluetooth quick action button to enable or disable Bluetooth in Windows 10.

Click on Bluetooth quick action button to enable or disable Bluetooth in Windows 10

Method 2: Enable or Disable Bluetooth in Windows 10 Settings

1. Press Windows Key + I to open Settings then click on Devices.

Press Windows Key + I to open Settings then click on Devices

2. From the left-hand menu, click on Bluetooth & Other Devices.

3. Now in the right window, pane toggle the switch under Bluetooth to ON or OFF to Enable or Disable Bluetooth.

Toggle the switch under Bluetooth to ON or OFF

4. When finished, you can close the Settings window.

Method 3: Enable or Disable Bluetooth in Airplane Mode Settings

1. Press Windows Key + I to open Settings then click on Network & Internet.

Читайте также:  Xiaomi mini wireless bluetooth

Click on Network & Internet | Enable or Disable Bluetooth in Windows 10

2. From the left-hand menu, click on Airplane mode.

3. Now in the right window pane under Bluetooth toggle the switch ON or OFF to Enable or Disable Bluetooth in Windows 10.

Under Airplane Mode switch ON or OFF the toggle for Bluetooth

4. Close Settings window and restart your PC.

This is How to Enable or Disable Bluetooth in Windows 10, but if you are still stuck, follow the next method.

Method 4: Enable or Disable Bluetooth Hardware in Device Manager

1. Press Windows Key + R then type devmgmt.msc and hit Enter.

devmgmt.msc device manager

2. Expand Bluetooth, then right-clicks on your Bluetooth device and select Enable if the device is already disabled.

Right-clicks on your Bluetooth device and select Enable if already disable

3. If you want to disable Bluetooth, then right-click on your Bluetooth device and select Disable.

4. When finished close Device Manager.

Recommended:

That’s it, you successfully learned How to Enable or Disable Bluetooth in Windows 10, but if you still have any questions regarding this tutorial then feel free to ask them in the comment’s section.

Источник

How to Turn On or Fix Bluetooth in Windows 10

Steve Larner Steve Larner Steve Larner carries over ten years of content management, editing, and writing experience in a wide variety of industries. As a tech enthusiast, Steve also enjoys exploring new products and devices and helping others solve their technological problems. Read more October 15, 2022

If nothing has worked so far, try using “Device Manager” to see if Bluetooth is listed. Take note that your PC may support Bluetooth functionality and still not show up in the devices list. That scenario occurs when there is no Bluetooth driver set up for the external adaptor or internal component. However, internal Bluetooth devices generally get detected, whether installed or not.

  1. Click on the Cortana search bar and type “Device Manager,” and select it from the list.
  2. Look for Bluetooth entries in “Device Manager.” If you see them, then the PC supports Bluetooth, but it may not be working correctly. Bluetooth locations in “Device Manager” include Bluetooth, Network adapters, and Other devices. If the item and driver are not listed, move on to step 3.
  3. As previously mentioned, your PC can still support Bluetooth and not show it in Device Manager. In that case, you need to install the appropriate driver.

If you find a Bluetooth device within Device Manager and you still can’t turn it on, the issue lies elsewhere.

Update the Bluetooth Driver

Whenever a feature on a Windows computer doesn’t work, you should always look for updates. Like most components, Bluetooth adapters need software to work, and Windows 10 updates have been known to break device drivers and functionality.

Drivers are updated either manually or automatically. The manual method might be a bit tedious, but it will do the job. Just find out which Bluetooth device your computer is using (from the Device Manager). Then, search the name of the device and download the drivers from the official website.

Alternatively, you can download a third-party program that automatically downloads any missing drivers to your computer. These services are often paid options. However, be careful if you choose third-party software. Some programs are more apt to install the wrong driver. Back up your system drivers (at the least) before using the software to update your system components.

Читайте также:  Найти наушники беспроводные bluetooth

After installing the drivers (one way or another), restart your computer and try turning the Bluetooth on again.

Re-Enabling the Bluetooth Software

Sometimes, system errors occur that cause components to stop working correctly. This situation often happens with Bluetooth components, and the best course of action is to give the devices a “wakeup call.”

  1. Go to “Device Manager” and find your Bluetooth component. Device Manager - Bluetooth
  2. Right-click it and select “Disable device.” Device Manager - Bluetooth - Disable
  3. Now, right-click the entry again and select “Enable device.” Device Manager - Bluetooth - Enable
  4. Restart your computer and try turning on Bluetooth again.

If enabling and disabling fails to solve your Bluetooth problem, try uninstalling the driver instead. Sometimes, a fresh installation is all the device needs. Don’t worry, as this won’t mess up the device or make it disappear from the list unless you choose to delete the driver.

Bluetooth Support Service

Now, we’re going to have to delve a bit deeper. If none of the above solutions worked, it’s time to use the “Run” feature.

  1. Hold down the “Windows” key and press “R” to bring up the “Run” window.
  2. Type “services.msc” without quotes in the command box, and then press “Enter” or click “OK.”
  3. A new window will appear with a list of entries. Right-click on “Bluetooth Support Service” and select “Start.” If you can’t click the Start option, choose “Restart.”
  4. Unless you want to repeat the process above every time you start your computer, there’s one more step to take. In the “Services” window, click “Bluetooth Support Service” again. Navigate to “Startup type found in the “General” tab and select “Automatic.” Click “Apply” and then “OK” if needed.

What Else Can Cause Bluetooth Failure?

Although one or more of the above methods generally solve Bluetooth problems in Windows 10, there’s a small chance that you’re still struggling to get Bluetooth to work. In this case, contacting the manufacturer or your retailer would be your best bet. If not, getting a USB Bluetooth adapter should help.

Sometimes, it’s as simple as forgetting to install or adequately reattach the Bluetooth board/device when performing a laptop or desktop teardown, whether for cleaning or repairs. That scenario would cause Bluetooth to disappear from the Device Manager and make it not work.

Turning On Bluetooth

Bluetooth

Bluetooth is a simple feature on Windows computers. However, that’s usually not the case. There’s a whole lot that can go wrong with it, from hardware to software issues. Before doing anything else, check if your computer supports Bluetooth in the first place (many older ones don’t) and update the software. Most likely, at least one of the methods should work.

Источник

Оцените статью
Adblock
detector