title: Is it possible to control Android bluetooth device pairing via adb?
body: <p>I'm looking into automating certain Bluetooth activities via adb.</p>
  
  <p>I have been able to successfully enable and disable Bluetooth using information found here: 
  <a href="https://stackoverflow.com/questions/37259260/android-enable-disable-bluetooth-via-command-line">android enable disable bluetooth via command line</a> 
  but need more capabilities and control than just enable/disable.</p>
  
  <p>While looking for solutions I came across this post:
  <a href="https://stackoverflow.com/questions/39339474/need-adb-command-line-to-start-a-youtube-video-using-browser?rq=1">Need ADB command line to start a youtube video using browser</a>
   where chrome is controlled via intents/activities.</p>
  
  <p>I've attempted a similar solution with Bluetooth by unpacking (using apktool) the Settings apk and the bluetooth apk, looking at their AndroidManifest.xml files for a list of their intents and activities - then using those intents and activities via adb, </p>
  
  <p>e.g. (running shell as superuser) </p>
  
  <pre><code>am start -n "com.android.settings.bluetooth.RequestPermissionActivity/android.bluetooth.adapter.action.REQUEST_DISCOVERABLE"
  </code></pre>
  
  <p>Thus far, commands of this nature have either:</p>
  
  <p>1) Failed outright, "unable to resolve intent" or similar issues</p>
  
  <p>2) Led to a ">" prompt wherein I'm expected to give more input (though I'm not sure what I would enter there)</p>
  
  <p>Ultimately, I'm seeking to control BT connections using adb (so as to be able to automate those tasks via scripts in the future). 
  I am using a Google Pixel 2 (rooted).</p>
  
  <p>If I am on the right track, any guidance or advice would be appreciated.
  If I'm going about this completely wrong, feel free to let me know (and hopefully let me know where I should be looking instead).</p>