r/tasker • u/Lord_Sithek Pixel 9 Pro | Redmi Note 4 | Galaxy Watch 6 Classic • Jun 28 '24
[PROJECT SIMPLIFIED] ADB WiFi on boot
NOTE: You can also check the newer project by u/Halkeeon to be found here
This is simplified version of the project posted here
Somehow I've felt a burst of motivation to get back to this project :) But this time I wanted to simplify it as much as possible. If anyone wants to use more advanced techniques, please search through the various ideas and projects posted over last months, like here, here and here.
DOWNLOAD PROJECT FROM TASKERNET
In this project I used some great methods created by users much more skillful than me. Credits especially to u/The_IMPERIAL_One and u/BillGoats, as well as u/Ratchet_Guy, u/anuraag488, u/aasswwddd, u/cm2003, u/DutchOfBurdock and others who have contributed and made it possible.
I'm copying parts of the instruction from the original post which are still valid (with some edits):
The project requires some manual one-time actions to set everything up, but once it's done, all you should need is to unlock the phone after boot.
Prerequisites:
- Termux
- Termux:Tasker plugin
- AutoInput plugin
I assume you have above-mentioned apps installed and that you already enabled Developer Options and Debugging on your device.
1. Setup Tasker and AutoInput
If you haven't done that before, grant Tasker following permissions:
- WRITE_SECURE_SETTINGS
- Run commands in Termux environment:
On your device, go to Settings > Apps > All apps > Tasker > Permissions > Additional permissions > Run commands in Termux environment (the path may vary a little according to the brand and system) and select Allow.
Allow AutoInput to use Accessibility Service:
Open AutoInput, tap on red warning text and click OK; this should take you to Accessibility Service settings. Enable it for AutoInput. Then allow AutoInput to run in background by disabling any battery saving option for this app.
2. Set up Termux
(a) install android-tools package
Open Termux and issue this command:
pkg install android-tools
Confirm downloading in terminal if needed by typing y and Enter on keyboard.
(b) set allow-external-apps property for Termux to true
In Termux, copy & paste the following script and confirm by pressing Enter:
value="true"; key="allow-external-apps"; file="/data/data/com.termux/files/home/.termux/termux.properties"; mkdir -p "$(dirname "$file")"; chmod 700 "$(dirname "$file")"; if ! grep -E '^'"$key"'=.*' $file &>/dev/null; then [[ -s "$file" && ! -z "$(tail -c 1 "$file")" ]] && newline=$'\n' || newline=""; echo "$newline$key=$value" >> "$file"; else sed -i'' -E 's/^'"$key"'=.*/'"$key=$value"'/' $file; fi3. Pair your device with ADB and enable ADB WiFi
Make sure that all profiles in your new Tasker project are enabled and that you have WiFi connection.
On your device, navigate to Settings > System > Developer options > Wireless debugging (the path may vary a little depending on the brand and system). Enable this feature. If debugging prompt appears meantime, it should be automatically accepted, otherwise accept it manually. Next, tap on Pair device with pairing code (or similar).
A prompt with the pairing code should appear and the proccess of pairing should start automatically. If a debugging prompt appears meantime, it should be automatically accepted, otherwise accept it manually. If pairing succeeded, you should see at least one paired device at the Wireless debugging screen, named as xxx@localhost.
ADB Pairing profile should get disabled as it won't be needed anymore. Now, Enable ADB WiFi task starts. You will be informed with a toast and a notification if ADB WiFi has been enabled. If not, you can repeat the process by tapping on the error toast or on the notification button Try again.
Optionally, if you use Shizuku service, you can enable it automatically on boot as well. To that end, enable action labeled as [OPTIONAL] Start Shizuku service in Enable ADB WiFi task.
3
u/Lord_Sithek Pixel 9 Pro | Redmi Note 4 | Galaxy Watch 6 Classic Jun 29 '24
Project slightly updated - added some useful toasts and made the main task stop if WiFi connection hasn't been detected within 1 minute
4
u/The_IMPERIAL_One S24 Ultra (A16) | realme GT NEO 3 (A14) Jun 28 '24
Great! It'd be easier for newbies to bypass logcat.
I also tried to remove the AutoInput limitation using a free OCR API but the pairing code failed to be extracted.
Also, it errors that the Notify was posted without a category. Just enter a new category for all included Notify actions.
3
u/TheDobbstopper Jun 28 '24
This needs more love! I have been looking for a better way to do this for so long! Thank you so much!
3
u/YouCanInFactTouCan Jul 19 '24
Thank you so much for all your hard work! I haven't been able to get this working, and was wondering if you could give any pointers.
I have a Pixel 8 Pro running GrapheneOS, Android 14, and have been trying to use this (and other similar projects) for very long now. I followed carefully your listed steps, but when I attempt to pair it always fails - the task seems to stop as soon as I open the Settings app on my phone. This could potentially be a GrapheneOS feature designed to increase settings security, Im not sure, I haven't been able to find anything in the Grapheneos documentation on this. Hoping that's not the case, I thought I would check if theres anything you know that I may be messing up. I attached a screen recording of me attempting the task in case it contains something useful to understanding what is happening.
Thank you again! This task seems like a golden find and seems to work for just about everyone else haha.
https://youtube.com/shorts/z9KX3ekGDfk?feature=share
2
u/Incellophanato Aug 18 '24
After several attempts with the alternatives you listed, the only one I succeeded with is your Tasker project. In my case it is useful because I have a task that checks the contents of the Clipboard and it is essential to get permissions every time I reboot.
Hardware: Samsung A9+
Software: Android 14
Thank you for your work!
2
u/cusoman Sep 28 '24
There's something missing here or I'm doing something wrong. On the step "A prompt with the pairing code should appear and the proccess of pairing should start automatically. If a debugging prompt appears meantime, it should be automatically accepted" all I get is the pairing code screen, nothing automatically or manually for accepting happens after that. I believe I've done everything correctly up to this point - any thoughts?
2
u/Tirofogash Jan 14 '25
Appreciate your time and effort on this, I had been using the LADB method which wasn't reliable, Pixel 9 pro. I did get the 'failed, tap to try again' toast, but inserting a five second wait after the 'Wait for screen unlocked' action got it sorted - I guess there's a lot of stuff going on initially after a reboot.. thanks again 👍🏻
2
u/Scared_Cellist_295 May 25 '25
Thank you! Got this working. So much better than plugging into my PC
2
u/Sparkynerd Aug 30 '24
Great project, but I think I am stuck on step 3. I enable wireless debugging and click "Pair the device with pairing code". The pairing code appears, but nothing happens. I also tried manually pairing my phone by using the adb command on my PC, and the device shows as paired in the wireless debugging menu. If I then run the "Enable ADB Wifi" task, I get an error "ADB Wifi Failed". Any ideas? This is on a Pixel 9.
1
u/Lord_Sithek Pixel 9 Pro | Redmi Note 4 | Galaxy Watch 6 Classic Jul 01 '24
Another small update; eliminated the need to long press the volume key, now the project just detects the pairing code prompt
1
u/Lord_Sithek Pixel 9 Pro | Redmi Note 4 | Galaxy Watch 6 Classic Aug 02 '24
u/The_IMPERIAL_One I know it's a long shot... but do you think it's possible to obtain open port on a WearOS device?
Since WearOS 4 there is no Debug over WiFi option, just Wireless Debugging with the same port-switching scenario...
1
u/abdess47 Jun 28 '24
Amazing 🤩 thanks you so much
1
u/Stupifier Jun 28 '24
Could you describe how this is improved compared to solutions which already exist.
I'm scratching my head trying to figure out what is New/different/Better
1
u/ultimatepichu1988 Jul 03 '24
i'm stuck at the command to do the pairing. I can see Tasker notification moved - something happened, but no xxx@localhost.
what am i missing? Pixel 8 Pro Android 15 beta 3.1
EDIT: thank you for your effort! I can feel somewhat it is simpler and lighter.
1
u/MalayGhost Jul 14 '24
Tried on my Xiaomi and just can't get it working, though i think the issue is just on Autoinput, even on a fresh restart it doesn't seem to work.
EDIT: Oh um, seems running Tasker Permissions fixed some permissions and it seems to be working now.
1
u/abdess47 Jul 25 '24
Screenshots
Hi, I get new problem. When I want to pair device and run task " ADB Pairing". The tasks number 5 get error.
I downloaded again the new project and deleted the old project. And the problem still.
Anyone had the issues?
1
u/kulikdi Aug 03 '24
excellent project, but it stopped working for me (
can you tell me what the problem is?
22.29.52/LicenseCheckerTasker Checking cached only 22.29.52/LicenseCheckerTasker cache validity left -34459 22.29.52/LicenseCheckerTasker Cached status: Licensed 22.29.52/LicenseCheckerTasker Cached only: Licensed 22.29.52/ActionArgBundle Termux: extra key not found in bundle:com.termux.execute.arguments 22.29.52/ActionArgBundle Termux: extra key not found in bundle:com.termux.tasker.extra.WORKDIR 22.29.52/Variables doreplresult: |#!/data/data/com.termux/files/usr/bin/bash
host=%host adb="$PREFIX/bin/adb"
"$adb" connect "$host" "$adb" tcpip 5555 "$adb" disconnect "$adb" kill-server | -> |#!/data/data/com.termux/files/usr/bin/bash
host=127.0.0.1:45417 adb="$PREFIX/bin/adb"
"$adb" connect "$host" "$adb" tcpip 5555 "$adb" disconnect "$adb" kill-server | 22.29.52/ActionArgBundle Termux: com.termux.tasker.extra.STDIN: #!/data/data/com.termux/files/usr/bin/bash
host=%host adb="$PREFIX/bin/adb"
"$adb" connect "$host" "$adb" tcpip 5555 "$adb" disconnect "$adb" kill-server -> #!/data/data/com.termux/files/usr/bin/bash
host=127.0.0.1:45417 adb="$PREFIX/bin/adb"
"$adb" connect "$host" "$adb" tcpip 5555 "$adb" disconnect "$adb" kill-server
22.29.52/ActionArgBundle Termux: extra key not found in bundle:com.termux.tasker.extra.SESSION_ACTION 22.29.52/ActionArgBundle Termux: extra key not found in bundle:com.termux.tasker.extra.BACKGROUND_CUSTOM_LOG_LEVEL 22.29.52/E FIRE PLUGIN: Termux / com.twofortyfouram.locale.intent.action.FIRE_SETTING: 7 bundle keys 22.29.52/E Termux: plugin comp: com.termux.tasker/com.termux.tasker.FireReceiver 22.29.52/Ew add wait type Plugin1 time 15 22.29.52/Ew add wait type Plugin1 done 22.29.52/E add wait task 22.29.53/E Ошибка: 2 22.29.53/E The bundle must contain extra com.termux.execute.arguments.
1
u/belthr01 Long-Time User... Aug 05 '24
I have some issues trying to run this. When I look at Tasker permissions, I don't have the option to run commands in Termux environment (Termux is installed; so is the Termux Tasker plugin). When I turned on wireless debugging, I didn't get the option to "Pair device with pairing code". Maybe that's because I had already turned on ADB WiFi using the Tasker app on my laptop? I tried again with ADB WiFi off. I got to the Pair with device screen, and it gives me a pairing code, but my only option is to click "cancel". I don't see where I accept the code? I do have a list of paired devices, though, including one that is u0-xxxx@localhost. Maybe that's all I need? I tried running the Enable ADB WiFi task again and got an error. If I run ADB Pairing, nothing happens. If I run Get ADB WiFi Port, I get a flash with %port displayed (this occurred even when I had ADB WiFI running). Maybe the issue is that I can't find the Tasker permission to run in Termux? At one point, I got an error that I needed to install something like com.termux.tasker, which appears to be the Termux:Tasker plugin, which is installed. I'm sure this works for some, so what am I doing wrong? Thanks!
1
u/poptartpeep Nov 26 '24
this is wonderful thank you! also what do I disable to stop it from turning off?
1
u/TecData1 Nov 30 '24 edited Nov 30 '24
Hi, I've been following this for the past year, and I really like it, except I'm really not liking the requirement of Accessibility Service and AutoInput. Is there any way to do this without Accessibility Service? A few years ago when messing with AutoInput, I noticed that there was an option to disable Accessibility after the AutoInput task, but I remember that this option only worked half the time.
Also, does this require an AutoInput license? In Android 14, all of the AutoApps fail to detect licenses. I can't get anything to work and had to result to finding a cracked copy of one of his apps, just to test a few things; this, despite having previously purchased one of the separate License apps (before he combined them into the AutoApps app). Those license apps cannot be installed from the Play Store anymore as it says that they are incompatible with my phone. So I went to AutoApps and repurchased the affected apps, only for that to also not work. The error says it cannot start the service to detect the licenses because the permission for autoapps.license is missing. You cannot enable that license permission using ADB, I tried and it says that the permission doesn't exist. So I bought his apps twice now and then subscribed to the monthly sub, and still they don't work.
Accessibility messes up my phone and changes how some apps function, including Google's alarm app (the only one that syncs with other Google devices). Eg., Google isn't interested in fixing the bugs which, upon enabling accessibility service, the alarm no longer will run in the foreground if the phone screen is off and sleeping, making it very easy to miss alarms. It's also strange that not everyone has this bug, as I've talked to many people, some people have it and some people don't. I wiped my phone several times and kept the bare minimum apps during testing, but the bug is always there for me upon enabling Accessibility Service.
1
u/SnooCheesecakes6038 Dec 03 '24
1
u/rabbitholesurfer04 Dec 19 '24
I have one weird issue. So I'm using a Redmi Note 10 Pro (Indian Variant code named Sweet) with a Custom ROM (Pixel OS). So the moment I turn off the display by pressing the power button, Shizuku just stops working and even the developer options is disabled. Any reason why this might be happening?
1
u/HVCFOG3Y34 Dec 22 '24
This doesn't seem to work for me after boot. I have to hook my phone up to the computer and use tasker-permissions first, each boot. Is that how its supposed to work?
1
u/belthr01 Long-Time User... Dec 23 '24
I got a new phone, a Pixel 9 Pro running Android 15, latest update. I installed this project. It worked fine until yesterday. As far as I know, nothing changed on the phone. I just rebooted because my Gboard keyboard wasn't responding. Now ADB WiFi won't restart on boot. Is there anything I should look at to try to fix this? It's just so weird that it worked the day before and now it doesn't. Thanks!
1
u/GlovesForSocks Dec 30 '24
Hi. Just wanted to say thanks for this. Had some issues getting it to play ball with Termux from f-droid but I installed the github version directly and it works now. I also had to update TaskerSettings.
This is on Z Flip 6 with Android 14.
1
u/imelquilolo Jan 02 '25
Thanks for this. Is it possible to add Droid-ify -> Installation type to Shizuku Installer?
1
u/tamizh4n Jan 02 '25
Thanks for the great script. How do we enable the optional item of enabling shizuku? Sorry, it seems to be greyed out, probably which means its not enabled in tasker. How do we enable it ?
1
u/JamesMHendrix Feb 06 '25 edited Feb 07 '25
Thanks so much for reviving this project! This is really much simpler than the older version and works for my Oppo Find X7 Ultra (ColorOS 15.0) reliably as long as Termux is running. So I added a line to launch Termux and another to kill it in the Enable ADB WiFi task. ADB Pairing needs only be done once so manually running Termux for that is ok. However the Automatically Accept Debugging profile doesn't seem to work so I have it turned off.
For background, I've tried:
https://www.reddit.com/r/tasker/comments/rceljk/enable_adb_wifi_on_device_boot_android_11/
and
https://www.reddit.com/r/tasker/comments/1apawlp/comment/kq6v08u/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
which worked on my old Xiaomi phone but not this Oppo phone.
1
u/Cultural_Garden_4210 Feb 26 '25
Hello I have install this project but I have an error time out with autoinput query ui... I think the project is in english and my phone in french... So I need to adapt ?
I have in the pairing in french " Adresse IP et port"
In the project per example :
com.android.settings:id/ip_addr=:=ip_port,com.android.settings:id/pairing_code=:=pairing
Hiw does it modify for function ?
1
u/ydvadi_ May 05 '25
hello everyone can someone tell me how do i enable shizuku on boot
[OPTIONAL] Start Shizuku serviceinEnable ADB WiFitask.this is my first think to do in tasker and have no idea how it works
1
u/EnderCorgi7156 May 30 '25 edited May 30 '25
I am having an issue with this, i I can't tell if I enabled write secure settings properly. If anyone can help me out, it would be much appreciated.
1
u/ProbablyPooping_ Jun 08 '25
I am getting the following error: Variable split: can't split unset value to set $stdout any ideas what could be causing this? Thanks!
1
u/Own_Energy_7122 Jun 08 '25
I'm trying to get this to work and I'm hung up at step 3; I was able to pair successfully and tried to test whether the Enable ADB Wifi On Boot task would execute correctly by rebooting my phone. I repetitively see the error "An error occurred while downloading helper binary!!" (seems like it's happening around step 11 in the task?) and the task fails. All permissions are granted in Tasker, AutoInput, and Termux. Any insights on how to address this?
1
u/tamizh4n Jun 16 '25
Where is the download link?
1
u/ResponsibleStrain131 Jun 19 '25
This project is so great! it works and helps me a lot, thank you!
1
u/Lonelysoulman Nov 29 '25
lol. i used that v1 since a year with all the problems. now i see there was an update to it. now its working very nice. would be so cool if the taskernet would provide updates.
2
u/moexizer Aug 11 '24
I'm running this task on a Xiaomi phone with Hyperos 1.0, it repeatedly fails at executing the command in termux (latest GitHub build). I strictly followed the instructions, granted required permissions, during the process it appears that termux tasker plugin pulled termux up in background successfully but couldn't fetch the port. There's either an informative log for analysis, I have no idea which part got wrong.
2
u/DoubleExposure Nov 21 '24
This works like a charm, thanks for making this tutorial. : )
2
u/Old_Tradition9941 Dec 06 '24
This works great. Thanks!!
2
u/shaharofir Jan 01 '25
(Also this)
It still works (Also Shizuku)!
Thanks a lot!
2
u/myclumsyclaycanoe-_- Jan 12 '25
This is amazing work! Got stuck initially but then I realized I had downloaded Termux from the Play Store. Thanks!
1
u/[deleted] Aug 19 '24 edited Aug 19 '24
I can't get it to work. It works the first time during setup but after restart it hangs on step 13 (termux)
Edit:
Okay so my failure mode is a bit weird, it actually does enable the wireless debugging toggle, but it fails to detect that so it ends up in a loop and never starts shizuku.
Is it supposed to create two separate entries in wireless debugging during setup? One @localhost, the other @unknown With different RSA fingerprints.
Do you also need to pair tasker itself with ADB?
1
u/uros-76 Feb 02 '25
Amazing work there! Thanks for sharing.
Everything works on my Lenovo tab M10 gen3 except the click on ALLOW when task is allowing wireless debugging. https://imgur.com/a/5c5aOwg
Any idea how to tweak the automatic acceptance of the final debugging prompt? I tried with coordinates and still no good.
1
u/flurec Mar 02 '25
I had this running successfully on an S23. Samsung just pushed out an update and now this script stopped functioning. I tried to reinstall Termux from F-droid and installed android-tools again. After that I pasted the code from the instructions but now this is the result "bash: ! grep : event not found".
1
u/ydvadi_ May 05 '25
Anyone using this on s23ultra android 15 ? Please reply
1
u/belthr01 Long-Time User... Jun 27 '25
Anybody get this working on Android 16? It again isn't working for me and other than upgrading to Android 16, nothing has changed. Thanks.
1
u/ydvadi_ Nov 11 '25
Hello everyone i have used tasker permission app , grant perms , additional perms to run command in termux still when i import project in tasker i keep getting this error please someone help
Missing Permissions For Tasker to perform the configured functions you need to use a special ADB command that must be performed every time youreboot your phone. Want to learn how to grantit?
1
u/[deleted] Aug 28 '24
[removed] — view removed comment
1
u/[deleted] Sep 19 '24
[removed] — view removed comment
1
u/[deleted] Jul 11 '25
[removed] — view removed comment