Android Enthusiasts
Q&A for enthusiasts and power users of the Android operating system
Latest Questions
1
votes
0
answers
65
views
Best practices for automating an Android device?
I'd like to set up a small bash script, which I'll write on my PC but then run from my Android phone. Objective: - When my phone connects to the Wi-Fi at home (detection possible via the SSID), the script should do the following: - When I get home, my phone connects to the Wi-Fi. - It then checks wh...
I'd like to set up a small bash script, which I'll write on my PC but then run from my Android phone.
Objective:
- When my phone connects to the Wi-Fi at home (detection possible via the SSID), the script should do the following:
- When I get home, my phone connects to the Wi-Fi.
- It then checks whether the static IP of my NAS is responding.
- If so, it connects to the NAS via SSH.
- It only copies photos and videos taken more than 2 weeks ago.
- It copies them to the NAS, in a defined folder.
- It deletes the source files from the phone if the copy went well.
There are lots of ways of doing this, but I'm trying to find out what the best practices are for this type of automation on Android. Which applications do I use? Which way do I do it? etc.
I'm open to any kind of recommendation, as long as it's good practice and maintainable! It must be professional.
alex_pythooon
(11 rep)
Jul 11, 2025, 10:19 PM
• Last activity: Jul 13, 2025, 02:16 AM
3
votes
1
answers
11997
views
How to run a script in background from adb shell?
I have a problem with USB tethering on my rooted Nougat phone (LineageOS). After some time phone stops USB tethering. To fix that I run the following script like this: adb shell su nohup sh tether.sh & exit exit tether.sh #!/system/bin/sh service list while true; do if ! pidof -s dnsmasq > /dev/null...
I have a problem with USB tethering on my rooted Nougat phone (LineageOS). After some time phone stops USB tethering. To fix that I run the following script like this:
adb shell
su
nohup sh tether.sh &
exit
exit
tether.sh
#!/system/bin/sh
service list
while true;
do
if ! pidof -s dnsmasq > /dev/null
then
echo -n "Connectivity lost at "
date -u +%FT%TZ
echo "Waiting 3 seconds..."
sleep 3
echo "Calling ConnectivityManager.setUsbTethering(false)"
service call connectivity 33 i32 0 2>&1
sleep 3
echo "Calling ConnectivityManager.setUsbTethering(true)"
service call connectivity 33 i32 1 2>&1
echo "Waiting 3 seconds..."
fi
sleep 3
done
Problem: If I use
nohup
my call to service call connectivity
fails with service not found. And I put service list
on top of the script which returns Found 0 services:
. However the same commands work when ran directly from adb shell; su
.
Why service call
doesn't work inside this background script? Does it need the same tty
to work?
Nazar554
(188 rep)
Aug 27, 2019, 08:33 PM
• Last activity: Jun 17, 2025, 06:35 PM
2
votes
1
answers
1002
views
ADB Shell: Reading exit codes from windows
So, I'm making a little batch script to be able to automate the whole process of flashing new roms for my Galaxy S6. Since its screen is broke, I have to do everithing manually from the adb shell, and since i'm having so many troubles with all the roms, I decided to make a little script to make my l...
So, I'm making a little batch script to be able to automate the whole process of flashing new roms for my Galaxy S6. Since its screen is broke, I have to do everithing manually from the adb shell, and since i'm having so many troubles with all the roms, I decided to make a little script to make my life easier.
This is what I got so far:
@echo off
setlocal enabledelayedexpansion
REM Factory settings
echo Formatting to Factory Defaults
adb reboot recovery
adb wait-for-usb-recovery
adb shell twrp wipe cache
adb shell twrp wipe dalvik
adb shell twrp wipe data
adb shell umount /sdcard
adb shell umount /sdcard
adb shell umount /data
adb shell umount /data
adb shell mke2fs -t ext4 /dev/block/platform/15570000.ufs/by-name/USERDATA
adb shell reboot recovery
adb wait-for-usb-recovery
REM Rom Flashing Section
set argCount=0
for %%x in (%*) do (
set /A argCount+=1
set "argVec[!argCount!]=%%~x"
)
echo Wiping /system
adb shell twrp wipe /system
for /L %%i in (1,1,%argCount%) do (
adb wait-for-usb-recovery
echo Flashing "!argVec[%%i]!"
adb shell twrp sideload
adb wait-for-usb-sideload
adb sideload "!argVec[%%i]!"
echo "!argVec[%%i]!" flashed
echo.
)
REM Debug enable
adb wait-for-usb-recovery
echo Enabling USB Debugging
adb shell mount system
adb shell "echo '' >> /system/system/build.prop"
adb shell "echo '# Enable ADB' >> /system/system/build.prop"
adb shell "echo 'persist.service.adb.enable=1' >> /system/system/build.prop"
adb shell "echo 'persist.service.debuggable=1' >> /system/system/build.prop"
adb shell "echo 'persist.sys.usb.config=mtp,adb' >> /system/system/build.prop"
adb push C:\Users\ffpp2\.android\adbkey.pub /data/misc/adb/adb_keys
REM Booting system
echo Rebooting into system...
adb shell reboot
echo waiting for phone to boot up
adb wait-for-usb-device
echo Launch scrcpy
"D:\Users\ffpp2\Documents\Celus\zeroflte\scrcpy-win64-v1.25\scrcpy.exe"
Now, I want to be able to evaluate every
adb shell ...
return code, so if anything happens mid way I can stop execution and I can get to fix what didn't work.
I havent been able to find anything regarding if adb shell forwards error codes back to the windows command prompt. Take a look at this:
D:\Users\ffpp2\Documents\Celus\zeroflte>adb shell mount /system
mount: mounting /dev/block/sda15 on /system failed: Device or resource busy
D:\Users\ffpp2\Documents\Celus\zeroflte>echo %errorlevel%
0
D:\Users\ffpp2\Documents\Celus\zeroflte>adb shell
~ # mount /system
mount: mounting /dev/block/sda15 on /system failed: Device or resource busy
~ # echo $?
255
~ # exit
D:\Users\ffpp2\Documents\Celus\zeroflte>adb shell cat asd
cat: can't open 'asd': No such file or directory
D:\Users\ffpp2\Documents\Celus\zeroflte>echo %errorlevel%
0
D:\Users\ffpp2\Documents\Celus\zeroflte>adb shell
~ # cat asd
cat: can't open 'asd': No such file or directory
~ # echo $?
1
~ #
As you can see, no error code was returned. And, in theory, it should be returned, since I didnt used the -x
argument:
Android Debug Bridge version 1.0.41
Version 34.0.0-9570255
Installed as C:\Program Files (x86)\ADB and Fastboot++\adb.exe
...
shell:
shell [-e ESCAPE] [-n] [-Tt] [-x] [COMMAND...]
run remote shell command (interactive shell if no command given)
-e: choose escape character, or "none"; default '~'
-n: don't read from stdin
-T: disable pty allocation
-t: allocate a pty if on a tty (-tt: force pty allocation)
-x: disable remote exit codes and stdout/stderr separation
emu COMMAND run emulator console command
...
Has TWRP anything to do with this?
fpp
(153 rep)
Feb 15, 2023, 04:28 AM
• Last activity: May 24, 2025, 03:26 AM
1
votes
0
answers
162
views
How to successfully execute a script from init.rc
I have an old stock Android 5.1.1. It has custom twrp recovery and is rooted. I have the stock boot.img file and am able to edit the init.rc and repack and flash it back with `fastboot flash boot boot.img`. No problem there. And after flashing the boot.img, I can `cat /init.rc` and can see the chang...
I have an old stock Android 5.1.1. It has custom twrp recovery and is rooted. I have the stock boot.img file and am able to edit the init.rc and repack and flash it back with
fastboot flash boot boot.img
. No problem there. And after flashing the boot.img, I can cat /init.rc
and can see the changes that I made to run a script from /system/xbin/
. However, the script does not execute at all. On the very end of init.rc
, I placed this line of code
on property:sys.boot_completed=1
start initAsic
service initAsic /system/xbin/script.sh
seclabel u:r:init:s0
user root
group root
oneshot
disabled
The script.sh is already chmod to 755 in /system/xbin/script.sh
and in script.sh
, there this
echo "hello" > /data/local/tmp/file.test
iptables -P FORWARD DROP
The problem is, it doesn't work. So googling further revealed that I need to set selinux
mode to permissive. And so I did with,
setenforce 0
It does set SELinux to permissive, however it's only temporary, because on reboot it goes back to enforcing mode. I was wondering if there was any way for me to modify the content within boot.img
that would lead SELinux to be permissive always.And also, is permissive mode the real reason why my init script isn't running, or am I doing something wrong?
randomuser
(11 rep)
Aug 10, 2024, 08:09 AM
• Last activity: Aug 10, 2024, 08:15 AM
68
votes
9
answers
193434
views
How can I run a script on boot?
I'm accustomed to running scripts on boot in Linux, but I'm not sure how to do this in Android. I'd like to start my SSH daemon on start, so I'll always be able to connect. How can I run an arbitrary script on Android boot? It'd be preferable to do this outside of Dalvik.
I'm accustomed to running scripts on boot in Linux, but I'm not sure how to do this in Android. I'd like to start my SSH daemon on start, so I'll always be able to connect. How can I run an arbitrary script on Android boot? It'd be preferable to do this outside of Dalvik.
Naftuli Kay
(2652 rep)
Mar 2, 2011, 09:15 PM
• Last activity: Jul 17, 2024, 04:27 AM
1
votes
0
answers
68
views
Setting a date on startup
I'd like to know if there's any way I can change the date settings on startup without root access. I'm using Urovo DT50 and Honeywell EDA71, both with Android 10. The problem is, these devices (and there's a lot of them in my workplace) connect to WiFi through the use of certificates, which have a p...
I'd like to know if there's any way I can change the date settings on startup without root access.
I'm using Urovo DT50 and Honeywell EDA71, both with Android 10.
The problem is, these devices (and there's a lot of them in my workplace) connect to WiFi through the use of certificates, which have a period of validity.
For some reason after a loss of power (changing the battery or just discharging it to 0%), the date in Android resets itself to 01.01.1970, resulting in the device being unable to connect to the network. I want to "automate" clicking through the settings and changing the date by hand. Or if there's a way to change the default date the device goes back to, that could also fix the issue.
As I mentioned, I don't have root access so I take into account that it might be unachievable, does anyone has any ideas?
Remas
(11 rep)
Jun 3, 2024, 12:19 PM
• Last activity: Jun 3, 2024, 04:30 PM
4
votes
3
answers
23712
views
Where can I run a .sh script on Android without root?
Lately I've been playing around with .sh scripting in Android. At first I used [BusyBox][1] and it's integrated scripting utility, though I quickly realised that coding on the phone isn't the best, so I switched over to my desktop and started using ADB to push my scripts to my device. It all worked...
Lately I've been playing around with .sh scripting in Android. At first I used BusyBox and it's integrated scripting utility, though I quickly realised that coding on the phone isn't the best, so I switched over to my desktop and started using ADB to push my scripts to my device. It all worked well for about two weeks, until recently the exact same scripts that used to work perfectly, tell me some
: not found: syntax error: '{
Error. I've copied the exact same code from my script and used BusyBox to create it for me, and that way it works just fine. So the code is fine.
After some digging, I think it's either because of permissions, because of encoding possibly, or also because of the location of the scripts. I've tried many different locations (because I want to be able to run the scripts without root), and ended up choosing /storage/emulated/0
. If I understood correctly, this is a symlink to the internal storage, which is read/write-able without root. But maybe sometimes executable and sometimes not? I don't know.
So my question is as following: **What is the best location on an Android Device to run scripts without root from?** Preferably a path that works on any android device.
Info:
- Rooted Samsung S7 SM-G930F
- Android 8.0.0
- I'm using #!/system/bin/sh
inside the .sh files
- I'm running the scripts with sh script.sh
- When trying to run it as an executable ./script.sh
, I get a Permission denied
error. With or without root.
PS: And if anyone has a clue to why the exact same scripts stopped working out of nowhere, I'd be happy to know!
**UPDATE:** Thanks to @IrfanLatif, I've managed to fix the : not found: syntax error: '{
Error! I was using Visual Studio Code as my editor for the scripts, which was saving them with the End of Line Sequence CRLF
, which Android doesn't like. For an easy fix, just change your Line Endings to LF
, problem solved. Check the comments out for more info.
Zebiano
(151 rep)
Feb 8, 2020, 12:21 PM
• Last activity: Feb 6, 2024, 07:00 PM
0
votes
0
answers
103
views
Can an app install be triggered solely via a script, without GUI interaction?
This current question is indirectly related to the following other question here: https://android.stackexchange.com/questions/255469/checking-via-a-script-whether-a-given-app-is-prohibited-from-installation-on-a-g I'm running stock rooted Android 11 and stock rooted Android 13 on two different devic...
This current question is indirectly related to the following other question here:
https://android.stackexchange.com/questions/255469/checking-via-a-script-whether-a-given-app-is-prohibited-from-installation-on-a-g
I'm running stock rooted Android 11 and stock rooted Android 13 on two different devices.
I'm wondering if there's a way that I could write a script that runs on the Android device and which will install a given app from the Play Store.
My goal is to initiate the app installation from the Android device without any GUI interaction; *i.e.*, no clicks nor button presses nor any manual operations, and I want this to be able to be accomlished solely within a script that gets executed on the device.
In the other question I referred to above, I found out that a slightly different Play-Store-related operation could not be invoked in this way, and that the only way it could be accomplished on the device itself is via GUI interaction ... either manually or via some sort of "uiautomator"-like automation.
Is this the same situation here? *i.e.*, is it impossible when running on the device to install any app from the Play Store without some sort of GUI interaction?
Thank you in advance.
HippoMan
(955 rep)
Dec 24, 2023, 11:54 PM
1
votes
1
answers
96
views
Checking via a script whether a given app is prohibited from installation on a given device?
(NOTE: the text of this question has been updated to make it much clearer than before as to what I'm actually looking for). I'm running stock Android 11 on one device and stock Android 13 on another device. I'd like to write a command-line script (not a Java-implemented app) that can run on both of...
(NOTE: the text of this question has been updated to make it much clearer than before as to what I'm actually looking for).
I'm running stock Android 11 on one device and stock Android 13 on another device.
I'd like to write a command-line script (not a Java-implemented app) that can run on both of these systems and on many other Android devices/OS's, and which can check whether or not a given app would be prohibited from installation via the Play Store on the specific device where the script is running.
To be clear, I am not simply interested in whether the app *exists* in the Play Store on the web. I'm looking for something more specific:
Some apps that exist in the Play Store on the web for general installation might be prohibited for installation on a specific, particular device. This could be for security reasons (*e.g.*, DEVICE integrity is not being reported on the device), or it could be because the device's Android version is too low, or there could possibly be other reasons. In these cases, the app does not even show up in the device's Play Store when searching for it to be installed, although the same app will indeed show up in a Play Store search on other devices that do not have these kinds of issues.
I want to be able to somehow query the current device's Play Store installation (not the generic, web-accessible Play Store pages) to see whether the given app might be prohibited for installation on the current device.
One example is the Netflix app. If the phone does not report DEVICE-level integrity, the user will not even see Netflix as existing when searching it in the Play Store on that particular device.
This is the case I'm trying to find a solution for.
For example, let's assume for the purpose of this discussion that the app happens to indeed be Netflix. That particular app's package name is "com.netflix.mediaclient". If my proposed script is named "app-in-playstore.sh", I'd like to be able to do the following, and have the script print either "false" or "true" to stdout, depending on whether or not this Netflix app is prohibited from installation via the Play Store on the device upon which the script is running, or whether its installation is indeed allowed on that particular device ...
/system/bin/sh app-in-playstore.sh com.netflix.mediaclient
(or perhaps preceded with "su -c" on a rooted device).
If the current device is reporting DEVICE integrity at the moment this script is being run, the script should print "true", because Netflix would indeed show up in the device's Play Store as installable.
If the current device is not reporting DEVICE integrity at the moment this script is being run, the script should print "false", because Netflix would not show up in the device's Play Store as installable.
To be clear, this isn't solely related to Netflix. I'm just using it as an example here, because I happen to know that it indeed will not show up in the Play Store if the phone is not reporting DEVICE integrity. I'm sure there are other apps that are treated similarly, and I want my script to be able to identify these other apps in the same way.
Is writing such a script possible? And if so, how could it be accomplished?
Thank you very much in advance.
HippoMan
(955 rep)
Dec 22, 2023, 07:25 PM
• Last activity: Dec 24, 2023, 02:02 AM
3
votes
0
answers
219
views
Totally automated way to check device's integrity level?
I'm looking for a way to check for my device's integrity level which can be done in an automated way ... for example, within a script. By "integrity level", I mean querying whether my device has "MEETS_BASIC_INTEGRITY" and "MEETS_DEVICE_INTEGRITY". I know I can manually do the following to query tha...
I'm looking for a way to check for my device's integrity level which can be done in an automated way ... for example, within a script.
By "integrity level", I mean querying whether my device has "MEETS_BASIC_INTEGRITY" and "MEETS_DEVICE_INTEGRITY".
I know I can manually do the following to query that info:
To first enable ...
PlayStore Options=>Settings=>About
... and then click Play Store Version
seven times to enable "PlayStore Developer" options
Then, after enabled, I can manually do the following any time I want to see the device's current integrity level ...
PlayStore Options=>Settings=>General=>Developer options=>Check integrity
However, I'd like to avoid this set of manual steps and instead, return this integrity info via some method which can be automatedly used within a script.
Is there any way that I can do this?
Thank you in advance.
HippoMan
(955 rep)
Dec 9, 2023, 03:00 PM
5
votes
2
answers
7371
views
How can I install Greasemonkey, Tampermonkey, or similar in Firefox Android?
I have Firefox 94.1.2 on a Pixel 3XL with Android 10. I'm trying to install a user-script extension like Greasemonkey Tampermonkey. addons.mozilla.org shows these are both available for Android: [Greasemonkey][1] [Tampermonkey][2] When I open the Add-on menu in Firefox, I see one add-on I have Enabl...
I have Firefox 94.1.2 on a Pixel 3XL with Android 10.
I'm trying to install a user-script extension like Greasemonkey Tampermonkey.
addons.mozilla.org shows these are both available for Android: Greasemonkey Tampermonkey
When I open the Add-on menu in Firefox, I see one add-on I have Enabled, and about 15 other "Recommended" (not of interest). I find no way to search for additional add-ons in addons.mozilla.org.
I found this article that said this issue would be fixed about a year ago, but I'm still not able to install add-ons.
This article implies that running Nightly versions of Firefox might allow more add-ons. Is there any other way to install these extensions?
tim11g
(433 rep)
Nov 21, 2021, 02:21 AM
• Last activity: Oct 30, 2023, 02:57 AM
0
votes
0
answers
1221
views
How to detect cpu architecture and deliver correct apk?
There are a variety of CPU architectures that android systems use such as ```arm64-v8a```, ```armeabi-v7a```, ```armeabi```, ```x86_64``` and ```x86```. Is there a way for ```adb``` or any other tool to detect the architecture of a connected device? I have many devices connected to a PC running adb...
There are a variety of CPU architectures that android systems use such as
-v8a
, -v7a
,
,
and
. Is there a way for
or any other tool to detect the architecture of a connected device? I have many devices connected to a PC running adb and I would like to create a script so that
can deliver the correct package.
For example, I have packages -v8a.apk
, -v7a.apk
and .apk
on my desktop that correspond to their respective architectures as well as tens of android devices that are connected to an
server on desktop. How can I iterate the output of devices
so that the script figures out the architecture of each android device and automatically install the right apk to each device?
aritl69
(1 rep)
Jan 12, 2023, 04:48 AM
2
votes
0
answers
1665
views
Why does Magisk not run my script on boot?
I have Android 10, Samsung a7. I have root by custom firmware + Magisk. I tried to put script in: ``` /data/adb/service.d/myscript /data/adb/post-fs-data.d/myscript /system/etc/init.d/myscript ``` But it doesn't run. Where I can put my script to execute after boot system? Script to execute: ``` #!/s...
I have Android 10, Samsung a7. I have root by custom firmware + Magisk.
I tried to put script in:
/data/adb/service.d/myscript
/data/adb/post-fs-data.d/myscript
/system/etc/init.d/myscript
But it doesn't run.
Where I can put my script to execute after boot system?
Script to execute:
#!/system/bin/sh
sleep 100
is_charging()
{
[ $(cat /sys/class/power_supply/battery/status) = Charging ] || [ $(cat /sys/class/power_supply/battery/status) = Full ] || return 1
}
# keep waiting
while is_charging; do sleep 1; done
# charger is disconnected, countdown
sleep 300
# again start waiting if charger is connected
is_charging && exec $(realpath $0)
# else, shutdown
/system/bin/reboot -p charger_disconnected ||
/system/bin/setprop sys.powerctl shutdown,charger_disconnected
Krzysztof Em
(31 rep)
Sep 25, 2022, 06:29 PM
• Last activity: Sep 26, 2022, 08:45 AM
4
votes
1
answers
1440
views
How does a update.zip file update files
I have been searching online on multiple sites and could not find one answer to this question, only found [one question][1] online but with no answer. How does the Android recovery update files from an `update.zip` file using the `package_extract_dir("");` code in the updater-script? 1. Does it clea...
I have been searching online on multiple sites and could not find one answer to this question, only found one question online but with no answer.
How does the Android recovery update files from an
update.zip
file using the package_extract_dir("");
code in the updater-script?
1. Does it clear the folder and copy the files in update.zip to that folder?
2. Does it just copy the files over (that don't already exist on the device) and not overwrite any files?
3. Or just copy the files from update.zip and overwrite any previous files?
This is using the default Android recovery screen, I am sure it is option 3, but just for anybody asking this question, want to know for definite.
user86581
Mar 16, 2015, 08:54 PM
• Last activity: Sep 6, 2022, 04:31 PM
0
votes
0
answers
225
views
How to build a script to stop infinite scrolling in any app
How can I build a code/script to stop infinite scrolling (or scrolling at all) in any app I want to, like YouTube Shorts, IG Reels and Tiktok. Script should not break any app from running at all and other functions should work. Rooting is permissible. I think there would be a need to change some cod...
How can I build a code/script to stop infinite scrolling (or scrolling at all) in any app I want to, like YouTube Shorts, IG Reels and Tiktok. Script should not break any app from running at all and other functions should work.
Rooting is permissible.
I think there would be a need to change some code near to Android base.
Satyam
(11 rep)
Jul 14, 2022, 09:10 AM
1
votes
0
answers
200
views
The first few scripts at Android boot-up
What are the first scripts executed by the Android boot-up process before it starts running processes that do not have root privileges?
What are the first scripts executed by the Android boot-up process before it starts running processes that do not have root privileges?
Tempus Nomen
(111 rep)
Jul 12, 2022, 08:25 PM
1
votes
0
answers
652
views
How can I dump UI hierarchy to a variable in Bash?
I want to dump the output of `uiautomator dump` to a variable and read it from there. How can I edit the below script so as to achieve that? #!/system/bin/sh while true ; do uiautomator dump sleep 1 done
I want to dump the output of
uiautomator dump
to a variable and read it from there. How can I edit the below script so as to achieve that?
#!/system/bin/sh
while true ;
do uiautomator dump
sleep 1
done
Jideofor5050
(51 rep)
Apr 17, 2020, 07:59 AM
• Last activity: May 28, 2022, 09:23 PM
0
votes
1
answers
654
views
How to periodically switch on and switch off flashlight with 1kHz rate on rooted Redmi Note 5 Oro?
My objective is to write a shell script to periodically turn off and on my phone's flashlight (about 1 kHz or 500Hz). My phone is rooted. So I gained superuser shell access (#) These are the files under my `sys/class/leds/flashlight` ``` whyred:/sys/class/leds/flashlight # ls brightness device max_b...
My objective is to write a shell script to periodically turn off and on my phone's flashlight (about 1 kHz or 500Hz). My phone is rooted. So I gained superuser shell access (#)
These are the files under my
)
I was able to modify the content of the
)
I was able to clock into a period of about 1-3ms by writing a bash script, that echoes brightness 100 followed by sleep and then echoes 0 brightness
Script:
sys/class/leds/flashlight
whyred:/sys/class/leds/flashlight # ls
brightness device max_brightness power subsystem trigger uevent
(
brightness
file and was able to manually switch off and on my flashlight. However, I want to periodically switch on and off with a delay and for that, I need a timer trigger. But within the trigger
file above, there is no delay section indicated. There was just some contents within the file (no numbers)
whyred:/sys/class/leds/flashlight # cat trigger
[none] bkl-trigger switch0_trigger flash0_trigger flash1_trigger torch0_trigger torch1_trigger switch1_trigger flash2_trigger torch2_trigger dc-online usb-online main-online pc_port-online battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid rfkill0 mmc0 mmc1 bms-online parallel-online rfkill1
(
while [ 1 le 100]
do
echo "100" > ~/sys/class/leds/brightness
sleep(0.001)
echo "100" > ~/sys/class/leds/brightness)
sleep(0.001)
done # end
But I want at least a 1 kHz frequency, so a timer is the one, sleep function is not advisable.
How can I about attaining my objective?
Edmund Kemper
(1 rep)
Apr 12, 2022, 01:48 PM
• Last activity: May 4, 2022, 05:22 AM
0
votes
1
answers
1064
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 updating, makes a su directory in /system/bin/su that suhide detects so that it won't install. I need to...
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 updating, makes a su directory in /system/bin/su that suhide detects so that it won't install. I need to delete that directory in between of the flashes, and I would like to make a script that does that for me when i flash it so that I can flash all files together on update using CyanDelta. I know that this is possible because I have seen other zips that execute command scripts as i flash them.
Schanche
(1 rep)
Oct 13, 2016, 04:05 AM
• Last activity: Apr 2, 2022, 02:01 PM
0
votes
0
answers
516
views
Start script to run app
I have a device connected to a TV, I need that when I start the device it automatically opens the player and plays a video. I thought that I could do the same as linux, writing a bash script, it would be relatively easy and it would start at startup, well linux already has such a startup script. But...
I have a device connected to a TV, I need that when I start the device it automatically opens the player and plays a video.
I thought that I could do the same as linux, writing a bash script, it would be relatively easy and it would start at startup, well linux already has such a startup script. But I can't find the /etc directory.
On the other hand, how are the orders of the app? To be able to write it in the script? And your options.
Also if there is another option I would like to know it.
Thanks.
fah81
(1 rep)
Mar 14, 2022, 07:24 PM
Showing page 1 of 20 total questions