1

I am making a shell script for Android to run on ADB, however, the script should download a file. Commands like wget and curl aren't available in /system/bin. Here are a few possibble solutions that I thought of, each with its cons:

  1. Rooting and installing BusyBox (my target systems are rootless)
  2. Downloading file in computer using wget or curl then transferring the file to Android with adb push (the script should be ran on Android, not the computer connected to it)
  3. Downloading wget or curl in Android (how can I download a binary without them in first place???)
  4. Termux (nope, my script sets some settings in Android which Termux can't)

Is it even possile? If yes, how?

3
  • 1
    Why don't you just include an HTTP library in your command-line program and download the file yourself? You are developing a command-line program not a shell script.
    – Robert
    Commented Jan 8, 2023 at 11:57
  • I am developing a shell script. I will make edits to clarify
    – sudoer
    Commented Jan 8, 2023 at 12:23
  • 1
    Put your busybox or wget or curl binary in /data/local/tmp/ and execute from there. Simple. Commented Jan 8, 2023 at 13:14

1 Answer 1

2

You have two options.

  1. Install Termux, which supports curl.

  2. Use your option number 2. adb push simply copies the file (unlike adb install, which looks for an apk file and tries to install it on the device).

Since you say that you are writing a shell script, you will have to install an Android terminal and (presumably) a Linux environment anyway.

You say "my script sets some settings in Android which Termux can't." If you need root access for an app, you may get what you need using Magisk.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .