This is an automated archive made by the Lemmit Bot.

The original was posted on /r/tasker by /u/Lord_Sithek on 2024-06-28 15:23:40+00:00.


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.

I added a profile which automatically accepts debbuging prompts (screen needs to be on). Also when device boots, a child task is executed to suspend the main task until the screen is unlocked. Then the main task waits for WiFi to be connected.

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:

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:

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; fi

3. Pair your device with ADB and enable ADB WiFi

Make sure that ADB Pairing profile in your new Tasker project is 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, it should be automatically accepted, otherwise accept it manually. Next, tap on Pair device with pairing code (or similar).

With the pairing code visible, long press the Volume Up button to make pairing. If debugging prompt appears, 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 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.