Overview
PhoneClaw provides a suite of utility functions that complement the vision-based automation features. These functions handle common tasks like delays, text-to-speech, app launching, and data manipulation.Delay Functions
delay()
Pause script execution for a specified duration.Number
required
Duration to wait in milliseconds (1000ms = 1 second)
Text-to-Speech
speakText()
Provide voice feedback during automation.String
required
The text to speak aloud via device text-to-speech engine
App Launching
launchTikTok()
Launch the TikTok application.com.zhiliaoapp.musically
launchGmail()
Launch the Gmail application.com.google.android.gm
Both launch functions check if the app is installed and provide voice feedback if not found.
Email Automation
sendEmail()
Automated email composition workflow (experimental).String
required
Recipient email address
String
required
Email subject line
String
required
Email body content
- Launches Gmail
- Uses
magicClicker()to find compose button - Types recipient in editable field
- Types body in text area
- Waits with built-in delays between steps
Data Parsing
While there’s no built-insafeInt() function in the current implementation, you can safely parse integers using JavaScript:
Safe Integer Parsing
Parsing Scraped Data
String Utilities
Common String Operations
Accessibility Helpers
Direct Click (Coordinate-Based)
For when you know exact coordinates:Device Information
Get Device Details
While not directly exposed as utility functions, PhoneClaw tracks device information:magicScraper():
Logging and Debugging
Console Logging
Voice Logging
Error Handling Utilities
Retry Logic
Timeout Wrapper
Best Practices
Recommended Delay Times
- After app launch: 3000ms (3 seconds)
- After button click: 1000-1500ms (1-1.5 seconds)
- After navigation: 2000ms (2 seconds)
- After typing: 500-1000ms (0.5-1 second)
Complete Automation Example
Related Functions
magicClicker()- Vision-based UI clickingmagicScraper()- Vision-based data extraction