ADB? Where do I get it?

Ok, so I'm trying to get the WeatherApp sample in the SDK to work, and have my phone in USB debug more, and from the simulator, when I try to open the connection, it tells me to run a program called adp with two tcp port numbers. What is ADB and where to I get it? I've only found an Andriod IDE which mentions it.
  • You need to download an Android SDK. It's usually in the platform-tools subdirectory.

    Whatever IDE you are using ought to have that in the install instructions. Otherwise just search for Android SDK and read up on ADB and all the other parts of the SDK. You'll need to do that anyway.
  • Here's where you can download the Android SDK:

    http://developer.android.com/sdk/index.html

    It's not necessary to install Android Studio--ADB is included with the SDK Tools.
  • Thanks Brandon. Found it yesterday, but when I try to run "adb forward tcp:7381 tcp:7381", I now get two lines: "error: device not found".

    As this seems to be more for custom phone apps with connect IQ apps, maybe I'm missing (or misunderstanding) something here, as I'm trying to get the sample Weather app in the SDK to work, and I guess I assume that the GCM app on the phone with be the "other end". I'm using the stock GCM for Android (latest version in google play)
  • That is an adb error that means your device can't be found. If you type 'adb devices' it should list your phone. If it's not listed then you'll need to enable debugging on your phone. I believe the steps to enable it are different based on your phone. See http://stackoverflow.com/questions/6469646/adb-devices-cant-find-my-phone for more information for more information.
  • adb devices shows no devices. I have a Nexus 7 (2013) connected (running lollipop), with USB debugging enabled (I get a notification when I plug on the Nexus 7 "USB Debugging Connected".)

    With a Samsung on 4.4.2, it shows "4d2003ec unauthorized" (again, USB debugging is enabled)

    the adb command results in two of the following messages:

    error: device unauthorized. Please check the confirmation dialog on your device.

    However, there is no confirmation dialog on the device.

    update: Restarted the phone and GCM and got the dialog, and allowed access... adb is now happy, but within the simulator, when I try to connect, I still get the same diablg about needing to run adb. "Could not connect to ADB".
  • Former Member
    Former Member over 10 years ago
    For clarification, ADB is used for sending data with the Communications API transmit() and for receiving data through the Communications mailbox.

    Running the weather sample on the ConnectIQ simulator does not require ADB or Garmin Connect Mobile. When the makeJsonRequest API is used on devices, they communicate via GCM, but the simulator connects directly through the internet connection on the computer the it is running on. You do not need to connect a phone to use makeJsonRequest in the ConnectIQ simulator.
  • @jm_m_58 The other piece that sometimes causes me trouble with ADB are the device drivers, especially if everything else seems happy but you see no devices listed when you execute 'adb devices'. It's usually necessary (in my experience) to visit the manufacturer's site and get the drivers for your specific phone.

    What Brian said is correct, however. You shouldn't need to use ADB to test the Weather sample. If you run the Weather sample, then choose Simulation -> Fit Data -> Simulate Data, the simulator will simulate a position, and the weather app should then display a city a temperature.
  • If you run the Weather sample, then choose Simulation -> Fit Data -> Simulate Data, the simulator will simulate a position, and the weather app should then display a city a temperature.


    This is the part I think I was missing, as the weather app was stuck on "Waiting for GPS", and I thought it needed to connect to something that had GPS! I'll be able to try it in a few hours. Thanks!

    update: Thanks! That was the missing part of the puzzle for me! It works!
  • Thanks again Brandon all all.

    A small request. Stuff in the "samples" directory are there for people just learning CIQ, as well as those looking for an example of how to do something.

    Next time you folks edit the main source for a sample, could you include a comment, with something like "If you run this in the simulator, do this to get it going:..." The ActivityTracking sample might be another candidate for a comment about "getting it going" (I figured that one out fast!)

    But with the weather sample, I admit, I've been tearing my hair out (the little that's left!) trying to get this to work. I first thought the simulator would use the location service on the PC, and then I thought it needed a real device with GPS (thus the ADB stuff)..
  • You have to play back a .fit file or simulate data. i.e., in the simulator, click Simulation > FIT Data > Playback File... or Simulation > FIT Data > Simulate Data.