A
A
Anton2020-09-24 13:38:31
linux
Anton, 2020-09-24 13:38:31

How to run adb commands from udev rule?

Good afternoon!
I wrote a rule for udev which, when a smartphone is connected, launches a script - then in the script you need to execute adb commands to automatically work with the smartphone (connect and install the application).
But as soon as I write any adb command, this script stops working.
I call the script like this:

RUN+="/bin/bash etc/udev/usb_on.sh %E{ID_SERIAL_SHORT} %E{ID_VENDOR} %E{ID_MODEL}"


So far, what I managed to google is that udev can simply kill a task that takes more than some time, but I still don’t understand how to run the script not through udev (
and is this the problem?

With bash and linux, I’m still very familiar bad, so I'll be glad for any help

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pfg21, 2020-09-24
@ibnsan

as an option, fork in the udev command itself or write a service and kick it from udev

C
ComodoHacker, 2020-09-24
@ComodoHacker

udev can just kill a task that takes more than a certain amount of time

If this is the problem (look at the log), then run your task through cron (or whatever is now instead of it).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question