help with learning Automate and BT toggle

255 views
Skip to first unread message

metropical

unread,
May 11, 2025, 1:12:48 PM5/11/25
to Automate for Android
I'd like to be able to get back the BT toggle feature so that I could nod off to music from my server via the Pixel 5 to a BT speaker.  
The Swiss app Sleep Timer was able to do this prior to the goog changes pre v23 SDK.

I've got adb working, enabled wireless ADB debug as well as Privileged in TCP/IP. 
Not sure if I got legacy-1.2 installed.

Found a flow that sounds like what I'd like.
MusicSleep Timer.flo

If someone would help, I'd appreciate it.
Get you a free ride to Tralfamador.
Not rooted.  MacOS Monterey, if it matters.
Thanks,

Fritz



Henrik "The Developer" Lindqvist

unread,
May 12, 2025, 9:38:26 AM5/12/25
to Automate for Android
Look in system Apps settings, that should tell if you got the Automate legacy extension app installed.
If your device is using Android 14 or higher then you can this flow to install the extension, please read: https://llamalab.com/automate/doc/extensions.html
If you got the "Privileged service" running then flows can use it to toggle Bluetooth by choosing it as "Bluetooth workaround" in Automate settings.

metropical

unread,
May 12, 2025, 12:30:25 PM5/12/25
to Automate for Android
Thanks Henrik,  Found the Legacy ext app, I believe.  Apps/All Apps//Automate/Additional Permissions/privileged or full (superuser) access to device features and storage.
Yes AOS 14.  I'll give the rest a go.

metropical

unread,
May 12, 2025, 5:12:06 PM5/12/25
to Automate for Android
dunno where I'm going wrong.
Thanks, when you can Henrik.

 Screenshot_20250512-130749.pngScreenshot_20250512-130810.pngScreenshot_20250512-170928.png

Henrik "The Developer" Lindqvist

unread,
May 12, 2025, 6:31:08 PM5/12/25
to Automate for Android
In your second screenshot you view the main app "Automate", not the "Automate legacy extension" app.
If you've not installed it, as the first screenshot say, download it from here then use this flow to install it.

metropical

unread,
May 13, 2025, 11:55:50 AM5/13/25
to Automate for Android
Hi Henrik,  Have the Automate Legacy app and the flow, but haven't been able to figure out the install method.
I imported to Automate and this is what follows, although maybe not in this order.

Screenshot_20250513-115001.pngScreenshot_20250513-114941.pngScreenshot_20250513-114859.png

Henrik "The Developer" Lindqvist

unread,
May 16, 2025, 6:37:13 PM5/16/25
to Automate for Android
  1. Click to select the "Pick and install APK" option.
  2. Click START to start the flow.
  3. The flow will show a file picker where you should browser to and click the "com.llamalab.automate.ext.legacy-1.2.apk" that you've downloaded, it's probably located the Download folder.
  4. Click the INSTALL button in the  confirmation dialog.
  5. A toast message should tell if the installation was successful, an dialog showing an error message if not.

metropical

unread,
May 16, 2025, 10:28:09 PM5/16/25
to Automate for Android
I get this error.  Seems a permission is missing? Perhaps in Automate settings?
When you have a minute Henrik.  Thanks.

Automate Old version.pngAutomate perms.png

Henrik "The Developer" Lindqvist

unread,
May 18, 2025, 3:09:44 PM5/18/25
to Automate for Android
What does the entire error message say? Scroll the log view, or use the Log, View menu.

metropical

unread,
May 18, 2025, 3:52:41 PM5/18/25
to Automate for Android
Hi Henrik
Log attached.
"05-18 15:37:59.958 F 20@4: java.lang.SecurityException: Permission Denial: reading com.android.externalstorage.ExternalStorageProvider uri content://com.android.externalstorage.documents/document/primary%3Aapks%2Fcom.llamalab.automate.ext.legacy-1.2.apk from pid=3562, uid=10422 requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs"

Thanks,
Fritz
flow-19.log

Henrik "The Developer" Lindqvist

unread,
May 18, 2025, 8:17:09 PM5/18/25
to Automate for Android
Odd, the file picker/other app wouldn't grant access.
After starting the flow did you "Await APK shared by apps" or "Pick and install APK" way?
If the former, try the latter.
If the latter then try enabling the "Long term persistent access" option in the Content pick block #18 and try again.

Android version?

Device brand & model?

metropical

unread,
May 18, 2025, 9:03:43 PM5/18/25
to Automate for Android
"pick & Install"

Did - "Long term persistent access" option in the Content pick block #18 and try again. 
Saved.
Still no joy.
Log attached.

Pixel 5 AOS14.
flow-19.log

Henrik "The Developer" Lindqvist

unread,
May 19, 2025, 8:56:14 AM5/19/25
to Automate for Android
Strange, did you copy the APK from a PC through USB?

Another workaround to try, edit the flow then add:
  1. Flow beginning: Title=Pick APK file
  2. File pick: Type=file, Show window=yes, Picked path=uri
  3. (connect to IN #8)
Message has been deleted

metropical

unread,
May 19, 2025, 11:24:17 AM5/19/25
to Automate for Android
hmmmmm, don't recall.  Maybe yes, maybe direct retrieve with the Pixel.
Is copy from the Mac via USB better method?
K, I'll try that.

I edited the 1st block, NP.
But I'm not what you mean in #2.  Is that an edit to and existing or a new block?
If new, where does it go?  Does it replace 2 & 19, then connect to 8?
Or ...?

Screenshot_20250519-110535.png

Henrik "The Developer" Lindqvist

unread,
May 19, 2025, 1:13:59 PM5/19/25
to Automate for Android
Whichever PC used probably doesn't matter, but i suspect that files transferred that over USB maybe has some weird file permission that's causing the issue.
No you should have added new block. You can also simply replace the #18 Pick content block with a File pick block with Type=File, Show window=yes, and Picked path=uri, ensure to reconnect the YES you've disconnected.
Message has been deleted

metropical

unread,
May 22, 2025, 10:52:15 PM5/22/25
to Automate for Android
I dl'd the "old install" flow direct to the Pixel 5.  N/C.

I tried the edit.  Snaps attached and log.  Did I forget to re-link the output of #38 to #8 In?

05-22 22:39:43.610 I 28@17: Flow beginning
05-22 22:39:43.611 I 28@21: Android version?
05-22 22:39:43.613 I 28@18: Content pick?
05-22 22:39:46.485 I 28@8: Variable set
05-22 22:39:46.486 I 28@4: Content copy
05-22 22:39:46.503 F 28@4: java.lang.SecurityException: Permission Denial: reading com.android.externalstorage.ExternalStorageProvider uri content://com.android.externalstorage.documents/document/primary%3Aapks%2Fcom.llamalab.automate.ext.legacy-1.2.apk from pid=27937, uid=10422 requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs
05-22 22:39:46.507 I 28@4: Stopped by failure
05-22 22:44:31.261 I 29@17: Flow beginning
05-22 22:44:31.262 I 29@21: Android version?
05-22 22:44:31.262 I 29@38: File pick?
05-22 22:44:44.147 I 29@0: Stopped at end
05-22 22:44:50.822 I 30@17: Flow beginning
05-22 22:44:50.823 I 30@21: Android version?
05-22 22:44:50.824 I 30@38: File pick?
05-22 22:45:03.414 I 30@0: Stopped at end
05-22 22:45:12.497 I 31@17: Flow beginning
05-22 22:45:12.501 I 31@21: Android version?
05-22 22:45:12.501 I 31@38: File pick?
05-22 22:45:34.771 I 31@0: Stopped at end


Screenshot_20250522-224619.pngScreenshot_20250522-224652.png

Henrik "The Developer" Lindqvist

unread,
May 23, 2025, 10:30:27 AM5/23/25
to Automate for Android
You need to connect the #38 File pick YES to #8 Variable set IN. otherwise the flow will stop.

metropical

unread,
May 23, 2025, 10:56:19 AM5/23/25
to Automate for Android
Getting closer me thinks.  Thanks for all this help Henrik.  Greatly apprciated.

05-23 10:45:51.273 I 32@21: Android version?
05-23 10:45:51.274 I 32@38: File pick?
05-23 10:45:59.113 I 32@8: Variable set
05-23 10:45:59.115 I 32@4: Content copy
05-23 10:45:59.173 I 32@23: Failure catch
05-23 10:45:59.173 I 32@29: Variable set
05-23 10:45:59.174 I 32@6: Dialog confirm?
05-23 10:46:01.754 I 32@24: Notification show
05-23 10:46:01.763 I 32@26: Shell command privileged
05-23 10:46:12.036 W 32@26: Failed to start privileged service
05-23 10:46:12.037 W 32@26: java.util.concurrent.CancellationException: Searching ADB services
05-23 10:46:17.124 F 32@26: java.util.concurrent.TimeoutException: Service startup timeout
05-23 10:46:17.144 I 32@9: File delete
05-23 10:46:17.159 I 32@34: Toast show
05-23 10:46:17.169 I 32@27: Notification show

Screenshot_20250523-104906.pngScreenshot_20250523-104934.png
Reply all
Reply to author
Forward
Message has been deleted
0 new messages