Sample Header Ad - 728x90

Install Python to run speedtest-cli on Android phone with no access to device - via adb

3 votes
2 answers
3193 views
I want to install Python on an Android phone (the phone is connected to a Raspberry Pi so I don't have any GUI or physical access to the device). I can connect to the phone via adb shell and run/install packages via APK files easily. I want to install Python on the device to run speedtest-cli remotely via adb shell. https://github.com/sivel/speedtest-cli speedtest-cli requires Python. So far I have tried the following based on online articles. 1. Installed Termux app via APK. I can access the underlying files remotely. I tried to install python using pkg command but could not. Error below.
1|:/data/data/com.termux/files/usr/bin # ./pkg install python                                                                                                                                               
    This must NOT be run as root as it will break your environment (root will be required for nearly everything due to changed file permissions)
    1|marlin:/data/data/com.termux/files/usr/bin # whoami
    root
2. Installed Qpython on the device using adb. However, the issue is that when I launch adb command to launch Qpython, I see a prompt on the device - "Allow Qpython to access media Options - Accept or Deny". Since I don't have access to the device, I can't select either of the options. Is there a way to send a command via ADB to select - Accept? I would appreciate any other ideas as well. My end goal is to run the speedtest-cli utility via adb shell on a device that is not physically accessible.
Asked by rfguy (51 rep)
Aug 3, 2019, 11:20 PM
Last activity: Jan 3, 2023, 03:35 AM