Simple way for Android USB debugging

I couldn’t find a simple guide on the forum for Android USB debugging.

  1. Install the packages needed for Android development in template. I’m using Fedora:

sudo dnf install android-tools

  1. In dom0:

Open qubes-policy-editor and create file 30-android.policy or run:
sudo nano /etc/qubes/policy.d/30-android.policy

Add:
#personal or other qube for Android connecting

qubes.ConnectTCP +5037 personal sys-usb ask default_target=sys-usb

  1. In sys-usb:

adb start-server

  1. Connect Android to the personal qube

  2. In personal (or other qube):

echo 4096 | sudo tee /sys/module/xen_gntalloc/parameters/limit
qvm-connect-tcp ::5037
adb devices

You will see this:

Binding TCP '@default:5037' to 'localhost:5037'...
List of devices attached
47142JEKC09172	unauthorized
  1. Then confirm and authorize the connection on your Android and check in personal qube:

adb devices

You will see this:

List of devices attached
47142JEKC09172	device
1 Like

Take a look at this guide:

Your way to deal with policies is deprecated since 2022 (R4.1), just follow the other guide or the official docs: How to edit a policy — Qubes OS Documentation

What is the purpose of this?

echo 4096 | sudo tee /sys/module/xen_gntalloc/parameters/limit
1 Like

This could be a Public Service Announcement:

"Remember folks, if you don’t know exactly what it does, don’t type it into dom0, or anywhere else!

I have no idea what this xen_gntalloc parameter does, and I would therefore treat it with 100% suspicion.

1 Like