Tiktok Android
by @mladjan
Automate TikTok engagement on Android using ADB. Search topics, comment with AI or templates, includes setup wizard. Use for TikTok automation campaigns and building social presence through strategic commenting.
clawhub install tiktok-androidπ About This Skill
name: tiktok-android-bot description: Automate TikTok engagement on Android using ADB. Search topics, comment with AI or templates, includes setup wizard. Use for TikTok automation campaigns and building social presence through strategic commenting.
TikTok Android Bot
Automate TikTok engagement on Android using ADB. No web scraping, no CAPTCHA, 100% success rate.
What It Does
Prerequisites
First-Time Setup
The skill includes an interactive setup wizard that runs automatically:
python3 tiktok_bot.py search --topics fitness --videos 5
Or run setup manually:
python3 setup.py
The wizard asks:
1. Topics - What to engage with (e.g., "fitness,cooking,travel") 2. Comment Style: - Static - Predefined templates (fast, free, no API) - AI - Claude/GPT Vision analyzes videos (smart, ~$0.01-0.05/comment) 3. Configuration: - Static: Enter 6-8 comment variations per topic - AI: Choose provider (Anthropic/OpenAI/OpenRouter) + API key
Setup saves to config.py and .env (both gitignored).
Usage
Search Mode - Target Specific Topics
Search for topics and comment on related videos:
# Single topic, 5 videos
python3 tiktok_bot.py search --topics fitness --videos 5Multiple topics, 3 videos each
python3 tiktok_bot.py search --topics "fitness,cooking,travel" --videos 3Specify device (optional)
python3 tiktok_bot.py search --topics gaming --videos 5 --device 001431538002547
Flow: 1. Searches each topic 2. Opens videos from search results grid (2x2 layout) 3. Generates comment (AI analyzes or uses template) 4. Posts comment 5. Returns to search results for next video
Explore Mode - For You Feed
Comment on random videos from For You feed:
# Comment on 10 random videos
python3 tiktok_bot.py explore --videos 10
Flow: 1. Starts on For You feed 2. Analyzes current video (if AI) or uses generic comment 3. Posts comment 4. Scrolls to next video
Comment Styles
Static Templates
Fast, reliable, no API costs. User provides 6-8 variations per topic.
Example config:
COMMENT_STYLE = "static"COMMENTS_BY_TOPIC = {
"fitness": [
"That form looks perfect! What's your workout routine?",
"Impressive progress! How long training?",
# ... more variations
]
}
AI-Generated
Claude Vision or GPT-4 Vision analyzes video screenshots and generates contextual comments.
Example config:
COMMENT_STYLE = "ai"
AI_PROVIDER = "anthropic"
AI_MODEL = "claude-3-5-sonnet-20241022"
API key in .env:
ANTHROPIC_API_KEY=sk-ant-...
Cost: $0.01-0.05 per comment depending on provider.
Configuration Files
After setup, you'll have:
config.py - Topics, comment style, templates/AI settings.env - API key (if AI mode).bot_settings.json - PreferencesAll gitignored by default.
Device Setup
Enable USB Debugging
Settings β About Phone β Tap "Build Number" 7 times
Settings β Developer Options β Enable "USB Debugging"
Connect device via USB and authorize computer.
Verify Connection
adb devices
Should show: device
adb shell wm size
Note screen resolution (e.g., 1080x2392)
Troubleshooting
"No Android device found"
adb kill-server
adb start-server
adb devices
Re-authorize on device if needed.
Search icon tap misses
Coordinates are optimized for 1080x2392 screens. For different sizes:
1. Take screenshot: adb shell screencap -p /sdcard/screen.png && adb pull /sdcard/screen.png
2. Find search icon pixel location (top-right)
3. Update in src/bot/android/tiktok_navigation.py:
search_icon_x = 995 # Your X
search_icon_y = 205 # Your Y
See references/COORDINATES.md for detailed coordinate guide.
AI generation fails
Check:
1. API key in .env file
2. API key is valid and has credits
3. Model name is correct
4. Falls back to generic comments automatically
Post button not working
Ensure keyboard is dismissed before tapping Post. The bot does this automatically with KEYCODE_BACK.
Performance
Timing
Success Rate
Cost (AI Mode)
Best Practices
Comment Quality
β Good:
β Bad:
Rate Limits
Account Safety
Advanced
Scheduling with OpenClaw Cron
openclaw cron add \
--name "Daily TikTok" \
--schedule "0 10 * * *" \
--tz "Your/Timezone" \
--payload '{"kind":"agentTurn","message":"cd /path/to/skill && python3 tiktok_bot.py search --topics fitness,gaming --videos 5"}'
Custom AI Prompt
Edit config.py:
AI_COMMENT_PROMPT = """
Analyze this video and generate a comment.
Topic: {topic}Your custom guidelines here...
Be enthusiastic
Ask specific questions
Reference visible elements
"""
Multiple Devices
Set ANDROID_DEVICE_ID environment variable:
ANDROID_DEVICE_ID=device1 python3 tiktok_bot.py search --topics fitness --videos 5
Or use --device flag:
python3 tiktok_bot.py search --topics fitness --videos 5 --device device1
Files Included
tiktok-android-bot/
βββ SKILL.md # This file
βββ README.md # Comprehensive docs
βββ setup.py # Interactive setup wizard
βββ tiktok_bot.py # Main script (CLI)
βββ config.example.py # Example configuration
βββ requirements.txt # Python dependencies
βββ scripts/
β βββ run_full_campaign.py # Legacy: 25-video campaign
β βββ run_complete_session.py # Legacy: 3-video session
βββ src/
β βββ bot/android/
β β βββ tiktok_android_bot.py # Core automation
β β βββ tiktok_navigation.py # Navigation flows
β βββ ai_comments.py # AI comment generation
β βββ logger.py # Logging utility
βββ references/
βββ COORDINATES.md # Tap coordinate guide
Requirements
loguru>=0.7.0
anthropic>=0.18.0 # If using AI mode
openai>=1.12.0 # If using AI mode
ADB must be installed and in PATH.
License
MIT - Use responsibly. Automated commenting may violate TikTok's ToS.
See Also
README.md - Full documentationreferences/COORDINATES.md - Coordinate customization guideπ‘ Examples
Search Mode - Target Specific Topics
Search for topics and comment on related videos:
# Single topic, 5 videos
python3 tiktok_bot.py search --topics fitness --videos 5Multiple topics, 3 videos each
python3 tiktok_bot.py search --topics "fitness,cooking,travel" --videos 3Specify device (optional)
python3 tiktok_bot.py search --topics gaming --videos 5 --device 001431538002547
Flow: 1. Searches each topic 2. Opens videos from search results grid (2x2 layout) 3. Generates comment (AI analyzes or uses template) 4. Posts comment 5. Returns to search results for next video
Explore Mode - For You Feed
Comment on random videos from For You feed:
# Comment on 10 random videos
python3 tiktok_bot.py explore --videos 10
Flow: 1. Starts on For You feed 2. Analyzes current video (if AI) or uses generic comment 3. Posts comment 4. Scrolls to next video
βοΈ Configuration
π Tips & Best Practices
Comment Quality
β Good:
β Bad: