Questions tagged [scripts]

Scripts are small programs written for a command interpreter or another scripting language.

Filter by
Sorted by
Tagged with
2
votes
1answer
662 views

how to display text on TWRP recovery screen using a sh file?

I'm trying to display message on TWRP 3.2.3-0 recovery screen using a .sh file. i was thinking using echo command to make that. my update-script is like this ifelse(is_mounted("/system"), unmount("/...
1
vote
2answers
730 views

How would I automate repetitive tasks in Android?

There are many tasks I do repetitively, like connect a Bluetooth headset or connect to a hotspot. How do I typically "code" this? How do I execute? Is there a consistent library or package manager, ...
3
votes
0answers
1k views

Help with this ADB REVERSE Tethering Script?

I added the functionality to automatically turn on reverse tethering after many fails: Now i only enter t into terminal alias t='r && sz $tether && r && sz $n' tether='am ...
0
votes
0answers
859 views

How to press & long press the "back" key with a terminal command?

We manage Zebra Mobile computing units running on Android 6.0 Marshmallow through an MDM. For some reason, the MDM interface doesn't show the Android buttons at the bottom of the screen (back, home, ...
0
votes
1answer
24 views

Listening to in-app triggers [closed]

How can we listen for and record in-app events? I've been searching the net for some time without the slightest hint. Bellow are my case specific details for clarity, (though maybe I should be ashamed)...
3
votes
1answer
14k views

Show a piece of a Google Spreadsheet document on Andriod main screen

I have a Google Spreadsheets document that is frequently updated and there are some cells in it that show a kind of short summary. Let it be a 2x2 block of cells that contains two headers and two ...
-1
votes
1answer
190 views

Android 4.2 - how execute shell command on system boot? [duplicate]

How do I do that? I have root access and the it's a custom build of AOSP project.
1
vote
4answers
5k views

Home screen icon for terminal program?

I'm using terminal-ide http://code.google.com/p/terminal-ide/ which is basically a terminal for android with all sorts of utilities. One is able to create bash scripts for example. Is there a way to ...
0
votes
0answers
354 views

Permission Denied on injected /sbin Scripts

I have an android device.. and Honor View 10... L04 version (US). I have a set of tweaks I am injecting into my kernels ramdisk, that all fire off without issue when I adb shell in and manually run ...
0
votes
1answer
79 views

Record setting changes as script?

I am looking for a way to record the setting changes I do manually, in order to be able to repeat them later by running the same script. I tried the MacroDroid app, but it doesn't look it has a "...
1
vote
0answers
340 views

How to set CPU frequency as early as possible?

What I mean by this question is the sequence of execution of scripts at boot time. Suppose I have this line of script: echo 307000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq I want ...
1
vote
3answers
11k views

How to create an update.zip file that can copy & rename a file?

Here's exactly what I'm looking for - I need an 'update.zip' file that can copy a file (example): /system/framework/file-to-copy.apk to another folder: /system/ and then it would rename the 'file-...
0
votes
1answer
3k views

regularly refresh Chrome tab

I have a Transformer Prime TF201 which I sit next to my main pc to display a webpage that shows stats about the systems I work on. However this page is a bit rubbish for updating and will time out ...
1
vote
1answer
576 views

How to Check if Script is run once device is booted?

I have a script I need to run once, and only once the phone is booted. I have attempted init.qcom.post_boot.sh, init.sec.boot.sh, debuggerd, and finally mkshrc While my script ran with debuggerd, I ...
0
votes
3answers
8k views

How can I run a custom .sh script at each startup (without native init.d support)?

This looks like a general concern of rookie Android system players who have just rooted their phones. The most prevalent method may be throwing your script into /system/etc/init.d. If the ROM supports ...
1
vote
1answer
107 views

Staging of several android devices made simple

I have to stage several android dongles to comply to my company’s need. I need to setup the WiFi, google account, download 3/4 apps, configure them, change background picture... i’v been Trying to ...
2
votes
1answer
264 views

Scripting app that can listen on notifications [closed]

I'm looking for an app that can run in the background, and listen for a silent notification from a different app (i.e. shows up on notification list but makes no sound) and once it appears, make a ...
1
vote
0answers
32 views

Script to disable email signatures in default Android email app

We use Airwatch to manage our company phones, and the task was handed to me to make sure the "Sent from..." default was disabled. Is it possible to create a script that could be pushed out to turn ...
0
votes
2answers
2k views

Executing script on device shutdown

For custom scripts at boot, we have init.d. I want to know if there's a possibility of executing a custom script when shutting down, something similar to init.d or by using an APK?
1
vote
0answers
195 views

TWRP - Redirect script stdout to recovery output

I have a flashable zip that runs a .sh script on flashing it via TWRP. What it does not do is that it doesn't print stdout of the script to the recovery output (although it logs it in /cache/...
0
votes
0answers
525 views

Automate Android with script/code

I was wondering if there was a way to automate/trigger different settings the way apps like Tasker and IFTTT do directly by coding. I had in mind somethin like a script that would run on the ...
3
votes
1answer
5k views

How to detect GPS status through adb shell?

I need to detect GPS status through adb shell. I have tried dumpsys location command but the output of this command is not changed when the GPS is enabled/disabled.
0
votes
0answers
110 views

Why sush tries to execute strings in my array as commands and how to prevent that?

When running a script that contains an array in a variable, the strings in the variable will be executed as a command, I don't need anything inside the array to be executed as a command, how to ...
1
vote
2answers
5k views

TWRP recovery: "pm install /path/to.apk" not working

I'm making a flashable zip for TWRP, to debloat my phone. I also want to install apps in the same script. However, when I do "pm install /path/to.apk" (whether in a script or through the terminal) I ...
1
vote
1answer
256 views

Termux/node.js steam hourboost on android

i'm newbie in scripting i'm trying to run node.js script with termux on android and i'm getting errors everytime i have no idea how to fix i know nothing about that so what code must i use? http://...
1
vote
0answers
2k views

LineageOS: run custom script (start service) at boot

Seems like a simple thing. How can I run custom script on my (rooted) android with LineageOS at boot? Neither creating it as /data/local/userinit.d/99sshd nor /data/local/userinit.sh did not help. ...
1
vote
1answer
1k views

How to create a service without any /system/etc/init.d directory

I would to get a boot daemon service. My android 6 device is rooted and I installed busybox pack on it. After remount my /system partition in read/write, I make /system/etc/init.d directory and I ...
2
votes
1answer
2k views

How can I run a shell script when some WiFi is connected?

I have a really simple shell script, that just adds a route to my internal development machine. This is useful, as that machine has some LXC containers inside, so I can reach all my containers from my ...
2
votes
0answers
1k views

Batch script use sqlite3 to edit settings.db

I want to create batch script to enable hidden languages in a Huawei phone. But every time I stuck can you guys spot where is my problem @echo off color e cd "%~dp0" mode con:cols=90 lines=40 adb ...
1
vote
1answer
6k views

Reason for chroot failure: tmp-mksh: chroot: not found

Introduction: I formatted a SDCard in ext4 and copied an ArchVersion on it to run it from Android like in this guide (step 6). Of course my device is rooted and am running the following scripts and ...
0
votes
3answers
14k views

How to run a script on a rooted android device?

We recently deployed a lot of android devices internally for displaying customized web page only. Device: RKM MK902 OS: Android 4.4.2 Rooted Wifi radius 8021x Dolphin browser with kiosk mode and tab ...
3
votes
0answers
592 views

How to run a script on USB OTG Drive?

First up - I do not have any experience at all with programming in Android or Linux environments. So, very sorry if this question sounds stupid. Here is what I am looking for: I use a USB drive in my ...
0
votes
1answer
821 views

Can I make a flashable zip executing commands?

I'm using cm13 on my OnePlus 3, along with systemless SuperSu and suhide. When I update cm (often), I need to flash both SuperSu and suhide. The problem is that cm comes with root access and when ...
2
votes
2answers
5k views

How can I manage "desktop" icons

I want to remove all the icons on the desktop, (and also in the bottom bar) and place new ones via ADB. My script already removes all the apps, but icons/shortcuts remanin there! Is there any command ...
0
votes
1answer
490 views

Clicking a checkbox to an app using a script

I need to automate accepting a terms & conditions on a 3rd party app installed on the Android device. I just need to click a checkbox on that app's T&C UI. Can someone please guide me how I ...
1
vote
1answer
207 views

Renaming text files based on a keyword inside the files

I have many files inside a folder with .txt extension. Now they are named randomly by an app but I want to rename each text file to some words written in those files itself after words Name: but ...
1
vote
0answers
728 views

Is it possible to have the system/kernel reverse x-axis touch input?

I have a galaxy S6 G920F. I have this problem with my touchscreen. The x-axis input is reversed. When I touch it on the left part it registers the touch on the right etc.. Is there a way to just ...
0
votes
0answers
123 views

CWM recovery Nandroid Backup

Is there any way to create a Nandroid backup inside CWM recovery, by using the /cache/recovery/extendedcommand file? (This file supports all the commands a normal updater-script file supports inside ...
0
votes
1answer
4k views

Terminal emulator permission denied on complex commands

I'm porting a script that runs well on android 4.0.4 to android 4.4.2 Simplified it does this: ls *.a | ./busybox xargs ./busybox rm -f I'm using a busybox binary in mi app's folder. The error I'm ...
3
votes
4answers
24k views

How do I script my phone?

What I mostly want to do, is quickly alter settings, add alarms etc. It is perhaps called something else? This is from a Windows PC. Language is not important, but I know Python and UNIX scripting. ...
2
votes
1answer
2k views

How do i root Android x86_64?

I installed android x86_64 and now I want to root it but all the root scripts are for 32-bit versions of Android. I am using console os lollipop that is not rooted. What are my options? Thanks
9
votes
2answers
21k views

On Android can I write scripts (similar to Win .bat files) to combine several command line commands?

On Windows, I can run two commands using a .bat file. How can I achieve the same thing on Android For example: update my podcasts by calling pcastclient /updateALL force sync of my pictures ...
1
vote
1answer
3k views

How can a shell script get the number of an incoming/outgoing call?

new user here from Montréal, Canada! So i have a shell script that runs when a call comes in, and another one that runs when i make a call. How can this script get the phone number of the caller / of ...
-1
votes
2answers
304 views

Executing a script

I'm new to Android and trying to find the simplest way to run a 2 line script that deletes files from a specific directory. I Googled the topic and created a file that I called test.sh which has 2 ...
2
votes
1answer
934 views

Acquire Android image using flash drive OTG

In Linux, the dd command is used to pull the image from the smartphone to computer. And of course, the smartphone need to be rooted before the dd command launched. Is there any specific command or ...
0
votes
0answers
437 views

How to remount /system from host shell script?

I am trying to remount the /system partition from a shell, and tried both commands suggested in this post, but it does not work. Here are the script commands I am issuing: adb shell mount | grep -e "...
1
vote
1answer
6k views

Automating adb commands

is there a way to run adb shell commands via windows? I would like to run a batch script such as this adb shell mount -o rw,remount /system exit Currently when i run the batch script it only runs ...
0
votes
0answers
122 views

Wanted: A shell script to automate upgrades

I have a rooted Nexus 5, but this question would apply, I think, to any rooted device running Android 5.x and higher. Note also this is a question about a script to run on a osx/linux to manipulate ...
2
votes
1answer
2k views

mount in /data/local/userinit.sh is not working

I want to map /sdcard/DCIM to /storage/sdcard1/DCIM using CM 12.1 on a I9100 I wrote those few lines to /data/local/userinit.sh: #!/system/bin/sh log -p i -t userinit "userinit start"; mount -o bind ...
0
votes
0answers
92 views

How to store list of installed (paid and unpaid) apps to a log file?

I would like to store a list of all paid and unpaid apps in a log file (which I would then upload to Google Drive or FTP to some other server). This way if my phone is lost, stolen, or breaks, I will ...