I'm currently using Tasker on Android and I want to create a task using 2 Run Shell's. The setup I have is...
1.Wait
MS 0 Seconds 10 Minutes 0 Hours 0
2.Run Shell
Command input tap 550 580
3.Wait
MS 0 Seconds 10 Minutes 0 Hours 0
4.Run Shell
Command input tap 550 1800
Currently the first Run Shell works fine but the second Run Shell never executes. Don't understand why it's not running the second Run Shell.
there might be few reasons for that:
you are pointing wrong coordinates
app, you're trying to interact with, does not support accessibility features
you do not have accessibility features enabled
other
to achieve your goal, I'd recommend using Tasker's plugin called AutoInput
as it gives you way more control over what you click, focus, type etc
Related
I have been trying to send a command to my device to double tap on the screen.
I tried to send this
adb shell input tap 600 1000
adb shell input tap 600 1000
However, it does not result into a doubletap.
Anyone willing to help me out?
This has worked for me pretty reliably until android 10; however, it no longer works on android 11 :(
I figured out a way to do it like this:
input tap <x> <y>&
sleep 0.1
input tap <x> <y>
as in
adb shell "input tap 520 1150& sleep 0.1; input tap 520 1150"
When digging around android 11 it seems that input command spawns up a JVM that is very slow, and it slowed down enough on android 11 to about 0.5 seconds, so the system does not recognize it as a double tap.
You can speed up the taps (or any user input) by including it in the same adb shell command. Previously I did this:
adb shell "input tap 520 1150; input tap 520 1150"
This will be easier on your system memory (as only one input command is executing at once) and may work pre android 11, but the one with & and explicit sleep between the two taps is what I switched to now.
When forcing the app standby-bucket
adb shell am set-standby-bucket <package> rare
and then getting the stand by mode using
adb shell am get-standby-bucket <package>
adb returns always 5 regardless of the set mode.
What does 5 mean and how to get this work as it should be? 5 is none of specified modes: https://developer.android.com/reference/android/app/usage/UsageStatsManager.html#getAppStandbyBucket()
Sometimes this works as it should be for a very short period of time after removing and reinstalling the app but then stops working for unknown reason.
The information is not depicted as clearly as it probably could be, but in the link you provided, under STANDBY_BUCKET_ACTIVE, it says:
Standby bucket values that are ≤ STANDBY_BUCKET_ACTIVE will not be throttled by the system while they are in this bucket. Buckets > STANDBY_BUCKET_ACTIVE will most likely be restricted in some way. For instance, jobs and alarms may be deferred.
That is, 5 means no throttling.
I have worked since last day on this topic. I want to develop android application about obd-ii scanner. There are many open source project on Github or Google Codes. I have to find obd-ii simulator to developed this application without car or any odb-ii chip.
I found OBDSim to create sample data and answer the requests that send by my application. I encountered many problems and solved these problems by reading many documents and blog post. But I have last one problem and I need to your helps.
New version of OBDsim support Windows for Bluetooth connection now with using com0com. When I install com0com, I faced signature problem and I solved this problem to disable related windows feature. I have also set incoming port of Bluetooth to COM4. Everything are good so far. After that I want to create virtual ports by using com0com. It already create one pair when install. They are CNCA0 and CNCB0. I am only trying to change second port of this pair from CNCB0 to COM4. But windows gives error about COM4 is already using. Still I completed and assign COM4 instead of CNCB0. After that I run obdsim.exe and it start to create log like this;
SimPort name: CNCA0
Successfully initialised obdsim, entering main loop
10.046624 seconds. 0 samples, 0 queries. 0.00 s/s, 0.00 q/s
10.049810 seconds. 0 samples, 0 queries. 0.00 s/s, 0.00 q/s
10.049377 seconds. 0 samples, 0 queries. 0.00 s/s, 0.00 q/s
In this duration, I started to android application and press start live data button. I give and error on android phone about Bluetooth Connection Error - read failed, socket might closed or timeout. This is one scenario.
In second scenario, I removed the break com0com and I directly connect OBDsim to COM4. And I run obdsim.exe again. It also hava same output as before scenario. After I started t android application output change like this.
Echo disabled
Echo disabled
Echo disabled
10.066543 seconds. 0 samples, 6 queries. 0.00 s/s, 0.60 q/s
Echo disabled
Echo disabled
Echo disabled
Echo disabled
Echo disabled
10.030909 seconds. 0 samples, 5 queries. 0.00 s/s, 0.50 q/s
Echo disabled
Echo disabled
Echo disabled
Echo disabled
Echo disabled
Echo disabled
10.034040 seconds. 0 samples, 6 queries. 0.00 s/s, 0.60 q/s
Echo disabled
Echo disabled
Echo disabled
And I cant see any changes on my application.
If you know what is the problem or something that I made mistake or I forget, I am waiting or your help.
Thanks.
Okey. I solved my problem about this topic.
First of all, com0com is not necessary to communicate with OBDSim on Windows.
I can successfully connect to my application and OBDSim and I can see values on my android phone screen.
My problem was about OBD Reader program on Android. I didn't understand the reason of this situation but OBDSim couldn't connect to all OBD readers. I suggest you to use torque lite android application when you try connect OBDSim. And you should be careful on order of process.
Firstly, you should make pair your computer and mobile phone. (Sometimes it is necessary to remove pair and make pair again.)
After that you should run > obdsim.exe -w COMx (x is your Bluetooth income port name. You can set this port on your PC's Bluetooth settings -> Com Ports)
Lastly you should open your application and try to connect your computer by Bluetooth.
This solution works for me. You can try other application.
Thanks,
M. Salih.
I have this shell command in android input tap 653 100 using Tasker app to simulate a tap command. This one is working but how do i execute the command for say 50 times or 100 times? I know I can add more task in Tasker App but Thats a lot of work. So if you know anything or any command that i can input like for example input tap 653 100 -100 or input tap 653 100 -50 which is -100 and -50 are for how many times a command should execute or how do i loop and execute a task in Tasker app. Thanks
for q in `seq 1 50`; do input tap 653 100 ; done
Should do the trick...
I know I can unlock the screen, pull down the notifications, and press the clear notifications button, but there's got to be a way to clear the notifications through ADB, right? I'm guessing it's some Intent sent through the 'am' command, or maybe something even simpler, but I can't seem to find anything on the net. All I'm getting is Java code for use with an apk.
Edit: I should probably mention that I'm running on 4.3, sometimes commands may vary between versions.
Try:
adb shell service call notification 1
If you know the type of the device and Android version, you can clear notifications using ADB without having rooted device.
The idea is to pull down notifications and swipe away all notifications one by one.
Pull down:
adb shell input swipe 0 0 0 300
Swipe away:
adb shell input swipe 0 400 300 400
It is important to mention, that the (x,y) is something that vary between different type of devices and Android versions. You will need to find by several checks what is the best x,y for you.
The full script
adb shell input swipe 0 0 0 300
num=$(adb shell dumpsys notification | grep NotificationRecord | wc -l)
echo $num
while [ $num -gt 0 ]; do
adb shell input swipe 0 400 300 400
num=$(( $num - 1 ))
done
More details can be found here: https://www.sromku.com/blog/android-adb-clear-notifications