Automate TikTok engagement on Android using ADB. No web scraping, no CAPTCHA, 100% success rate.
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:
Setup saves to config.py and .env (both gitignored).
Search for topics and comment on related videos:
# Single topic, 5 videos
python3 tiktok_bot.py search --topics fitness --videos 5
# Multiple topics, 3 videos each
python3 tiktok_bot.py search --topics "fitness,cooking,travel" --videos 3
# Specify device (optional)
python3 tiktok_bot.py search --topics gaming --videos 5 --device 001431538002547
Flow:
Comment on random videos from For You feed:
# Comment on 10 random videos
python3 tiktok_bot.py explore --videos 10
Flow:
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
]
}
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.
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.
Settings → About Phone → Tap "Build Number" 7 times
Settings → Developer Options → Enable "USB Debugging"
Connect device via USB and authorize computer.
adb devices
# Should show: <device_id> device
adb shell wm size
# Note screen resolution (e.g., 1080x2392)
adb kill-server
adb start-server
adb devices
Re-authorize on device if needed.
Coordinates are optimized for 1080x2392 screens. For different sizes:
adb shell screencap -p /sdcard/screen.png && adb pull /sdcard/screen.pngsrc/bot/android/tiktok_navigation.py:```python
search_icon_x = 995 # Your X
search_icon_y = 205 # Your Y
```
See references/COORDINATES.md for detailed coordinate guide.
Check:
.env fileEnsure keyboard is dismissed before tapping Post. The bot does this automatically with KEYCODE_BACK.
✅ Good:
❌ Bad:
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"}'
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
"""
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
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
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.
MIT - Use responsibly. Automated commenting may violate TikTok's ToS.
README.md - Full documentationreferences/COORDINATES.md - Coordinate customization guide共 1 个版本