Debug Android with openSUSE
11 April 2017, 4:39 pm
Filed under: hint, Noticias | Tags:

Too much time passed by without an entry here. So today I will just write down the few steps you’ll need to do to be able to debug your mobile. I’ll base this post on openSUSE because that’s what I use.

You might know that google developed some tools to communicate with your device. Basically that’s adb and fastboot. I’ll talk about adb today, as it’s a somehow handcrafted approach.

So let’s go. First of all you will need the adb tool. So install android-tools from your favorite openSUSE distribution [1].

sudo zypper in android-tools

That was easy. Now if you run adb on the command line it will start the server, but if you type

adb devices

Your mobile would not show up. That’s because you need to set up udev rules and add your Vendor to some magic file. To do so, you first need to find out your idVendor and idProduct of your mobile. So watch your kernel log while plugging in your device:

sudo journalctl -kf

you will see something like:
[23468.979604] usb 2-3: New USB device found, idVendor=2a47, idProduct=7f10

For the curious, yes it’s a bq [2].
So we need to create a udev rule to be able to connect to the device. For that we add, as superuser the following line to ‘/etc/udev/rules.d/51-android.rules’

SUBSYSTEM=="usb", ATTR{idVendor}=="2a47", ATTR{idProduct}=="7f10", MODE="0666", GROUP="dialout"

Now we need to add the id Vendor as well to ‘~/.android/adb_usb.ini’ but prefix it with a 0x. So you adb_usb.ini should have one idVendor per line, in our case it should look like this:

> cat ~/.android/adb_usb.ini
0x2a47

Now, in the developer options of your phone, enable debugging via usb and you should be fine to go. If it’s not working try to kill the adb server

adb kill-server

and see if your phone is set to connect to your computer using MTP.
Have fun!

[1] https://www.opensuse.org/
[2] https://www.bq.com/




Design a site like this with WordPress.com
Get started