2

Do you have any idea how can we configure and turn on the wi-fi hotspot using the command line (ADB console)?

6

You could try this:

  adb shell am start -n com.android.settings/.TetherSettings
  adb shell input keyevent 20
  adb shell input keyevent 66

The first command opens the Settings page for Tethering and Hotspot while the latter simulate key presses: Down and Enter respectively.

Note: For different Android versions you may have to adjust the simulation of key presses depending on where the hotspot setting is located under settings.


Special Credits : Firelord and Kristopher

Firelord originally posted this as a comment, so I put this as an answer as comments are easily deleted or difficult to find

| improve this answer | |
  • For android 5.0+ if this is not working then add another one more keyevent 20. Credits: Kristopher – xavier_fakerat Apr 26 '17 at 10:53
  • @xavier_fakerat where does the additional keyevent 20 go? Should it be 20 20 66 or 20 66 20? – Andrew Dec 20 '17 at 16:58
  • @Andrew 20, 20 and 66 i.e down, down, enter – xavier_fakerat Dec 20 '17 at 18:00
  • 1
    @xavier_fakerat Thank you! My phone actually has cyanogenmod on it, and enabling the hotspot is the first option in the settings, so all I needed to do was enter adb shell am start -n com.android.settings/.TetherSettings then adb shell input keyevent 66. – Andrew Dec 21 '17 at 14:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.