TikTok Android Bot
Automate TikTok engagement on Android using ADB. No web scraping, no CAPTCHA, 100% success rate.
What It Does
- - Interactive Setup - Wizard guides first-time configuration
- Two Comment Modes - Static templates (fast) or AI-generated (smart)
- Two Operation Modes - Search specific topics or explore For You feed
- Duplicate Prevention - Never comments twice on same video
- Flexible Configuration - User defines topics and comment style
Prerequisites
- - Android device with USB debugging enabled
- ADB (Android Debug Bridge) installed
- TikTok app logged in on device
- Python 3.9+
- USB cable
First-Time Setup
The skill includes an interactive setup wizard that runs automatically:
CODEBLOCK0
Or run setup manually:
CODEBLOCK1
The wizard asks:
- 1. Topics - What to engage with (e.g., "fitness,cooking,travel")
- 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:
CODEBLOCK2
Flow:
- 1. Searches each topic
- Opens videos from search results grid (2x2 layout)
- Generates comment (AI analyzes or uses template)
- Posts comment
- Returns to search results for next video
Explore Mode - For You Feed
Comment on random videos from For You feed:
CODEBLOCK3
Flow:
- 1. Starts on For You feed
- Analyzes current video (if AI) or uses generic comment
- Posts comment
- Scrolls to next video
Comment Styles
Static Templates
Fast, reliable, no API costs. User provides 6-8 variations per topic.
Example config:
CODEBLOCK4
AI-Generated
Claude Vision or GPT-4 Vision analyzes video screenshots and generates contextual comments.
Example config:
CODEBLOCK5
API key in .env:
CODEBLOCK6
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 - INLINECODE3 - API key (if AI mode)
- INLINECODE4 - Preferences
All gitignored by default.
Device Setup
Enable USB Debugging
CODEBLOCK7
Connect device via USB and authorize computer.
Verify Connection
CODEBLOCK8
Troubleshooting
"No Android device found"
CODEBLOCK9
Re-authorize on device if needed.
Search icon tap misses
Coordinates are optimized for 1080x2392 screens. For different sizes:
- 1. Take screenshot: INLINECODE5
- Find search icon pixel location (top-right)
- Update in
src/bot/android/tiktok_navigation.py:
CODEBLOCK10
See references/COORDINATES.md for detailed coordinate guide.
AI generation fails
Check:
- 1. API key in
.env file - API key is valid and has credits
- Model name is correct
- 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
- - Static mode: ~25 seconds per video
- AI mode: ~30 seconds per video (adds 5s for analysis)
- Full search session (5 videos): 2-2.5 minutes
- Explore session (10 videos): 4-5 minutes
Success Rate
- - 100% with working coordinates
- 0% if tap coordinates miss targets
Cost (AI Mode)
- - Claude Vision: $0.01-0.02 per comment
- GPT-4 Vision: $0.02-0.05 per comment
- 100 comments: $1-5
Best Practices
Comment Quality
✅ Good:
- - Specific observations or questions
- 10-25 words
- Genuine enthusiasm
- No emojis (sounds more real)
❌ Bad:
- - Generic praise ("nice video!")
- Spam or self-promotion
- Too short ("first!")
- Low-value ("🔥🔥🔥")
Rate Limits
- - 25-30 comments/day max per account
- Space sessions: Once daily, vary times
- Take breaks: Skip 1-2 days per week
- Monitor: Watch for shadowban signs
Account Safety
- - Age accounts: 7+ days before automating
- Manual activity first: Like, follow, browse naturally
- Vary behavior: Different topics, times, comment styles
- Start small: Test with 3-5 videos first
Advanced
Scheduling with OpenClaw Cron
CODEBLOCK11
Custom AI Prompt
Edit config.py:
CODEBLOCK12
Multiple Devices
Set ANDROID_DEVICE_ID environment variable:
CODEBLOCK13
Or use --device flag:
CODEBLOCK14
Files Included
CODEBLOCK15
Requirements
CODEBLOCK16
ADB must be installed and in PATH.
License
MIT - Use responsibly. Automated commenting may violate TikTok's ToS.
See Also
- -
README.md - Full documentation - INLINECODE14 - Coordinate customization guide
- Main repository: https://github.com/mladjan/androidSkill
TikTok Android Bot
使用ADB在Android上自动化TikTok互动。无需网页抓取,无需验证码,100%成功率。
功能特性
- - 交互式设置 - 向导引导首次配置
- 两种评论模式 - 静态模板(快速)或AI生成(智能)
- 两种操作模式 - 搜索特定话题或浏览推荐页
- 重复预防 - 从不重复评论同一视频
- 灵活配置 - 用户自定义话题和评论风格
前置条件
- - 已启用USB调试的Android设备
- 已安装ADB(Android调试桥)
- 设备上已登录TikTok应用
- Python 3.9+
- USB数据线
首次设置
该技能包含自动运行的交互式设置向导:
bash
python3 tiktok_bot.py search --topics fitness --videos 5
或手动运行设置:
bash
python3 setup.py
向导会询问:
- 1. 话题 - 要互动的内容(例如:fitness,cooking,travel)
- 评论风格:
-
静态 - 预定义模板(快速、免费、无需API)
-
AI - Claude/GPT视觉分析视频(智能,约$0.01-0.05/条评论)
- 3. 配置:
- 静态:每个话题输入6-8条评论变体
- AI:选择提供商(Anthropic/OpenAI/OpenRouter)+ API密钥
设置内容保存至config.py和.env(均已加入gitignore)。
使用方法
搜索模式 - 定位特定话题
搜索话题并评论相关视频:
bash
单个话题,5个视频
python3 tiktok_bot.py search --topics fitness --videos 5
多个话题,每个3个视频
python3 tiktok_bot.py search --topics fitness,cooking,travel --videos 3
指定设备(可选)
python3 tiktok_bot.py search --topics gaming --videos 5 --device 001431538002547
流程:
- 1. 搜索每个话题
- 从搜索结果网格(2x2布局)打开视频
- 生成评论(AI分析或使用模板)
- 发布评论
- 返回搜索结果继续下一个视频
探索模式 - 推荐页
评论推荐页的随机视频:
bash
评论10个随机视频
python3 tiktok_bot.py explore --videos 10
流程:
- 1. 从推荐页开始
- 分析当前视频(如使用AI)或使用通用评论
- 发布评论
- 滑动到下一个视频
评论风格
静态模板
快速可靠,无需API费用。用户为每个话题提供6-8条变体。
示例配置:
python
COMMENT_STYLE = static
COMMENTSBYTOPIC = {
fitness: [
这个姿势看起来完美!你的训练计划是什么?,
进步令人印象深刻!训练多久了?,
# ... 更多变体
]
}
AI生成
Claude Vision或GPT-4 Vision分析视频截图并生成上下文相关的评论。
示例配置:
python
COMMENT_STYLE = ai
AI_PROVIDER = anthropic
AI_MODEL = claude-3-5-sonnet-20241022
.env中的API密钥:
bash
ANTHROPICAPIKEY=sk-ant-...
费用: 每条评论$0.01-0.05,取决于提供商。
配置文件
设置完成后,您将拥有:
- - config.py - 话题、评论风格、模板/AI设置
- .env - API密钥(如使用AI模式)
- .bot_settings.json - 偏好设置
默认均已加入gitignore。
设备设置
启用USB调试
设置 → 关于手机 → 连续点击版本号7次
设置 → 开发者选项 → 启用USB调试
通过USB连接设备并授权电脑。
验证连接
bash
adb devices
应显示:<设备ID> device
adb shell wm size
记录屏幕分辨率(例如:1080x2392)
故障排除
未找到Android设备
bash
adb kill-server
adb start-server
adb devices
如有需要,在设备上重新授权。
搜索图标点击偏移
坐标针对1080x2392屏幕优化。不同尺寸时:
- 1. 截屏:adb shell screencap -p /sdcard/screen.png && adb pull /sdcard/screen.png
- 找到搜索图标像素位置(右上角)
- 在src/bot/android/tiktok_navigation.py中更新:
python
search
iconx = 995 # 您的X坐标
search
icony = 205 # 您的Y坐标
详见references/COORDINATES.md坐标指南。
AI生成失败
检查:
- 1. .env文件中的API密钥
- API密钥有效且有额度
- 模型名称正确
- 自动回退到通用评论
发布按钮无效
确保在点击发布前关闭键盘。机器人会自动使用KEYCODE_BACK完成此操作。
性能
时间
- - 静态模式: 每个视频约25秒
- AI模式: 每个视频约30秒(增加5秒分析时间)
- 完整搜索会话(5个视频): 2-2.5分钟
- 探索会话(10个视频): 4-5分钟
成功率
- - 100% 坐标正常工作时
- 0% 点击坐标未命中目标时
费用(AI模式)
- - Claude Vision:每条评论$0.01-0.02
- GPT-4 Vision:每条评论$0.02-0.05
- 100条评论:$1-5
最佳实践
评论质量
✅ 好的:
- - 具体的观察或问题
- 10-25个单词
- 真诚的热情
- 无表情符号(听起来更真实)
❌ 差的:
- - 通用赞美(好视频!)
- 垃圾信息或自我推广
- 太短(第一!)
- 低价值(🔥🔥🔥)
频率限制
- - 每个账户每天最多25-30条评论
- 间隔会话: 每天一次,不同时间
- 休息: 每周跳过1-2天
- 监控: 留意隐形封禁迹象
账户安全
- - 账户年龄: 自动化前使用7天以上
- 先手动操作: 自然点赞、关注、浏览
- 变化行为: 不同话题、时间、评论风格
- 从小开始: 先用3-5个视频测试
高级功能
使用OpenClaw Cron调度
bash
openclaw cron add \
--name 每日TikTok \
--schedule 0 10 * \
--tz 您的/时区 \
--payload {kind:agentTurn,message:cd /path/to/skill && python3 tiktok_bot.py search --topics fitness,gaming --videos 5}
自定义AI提示
编辑config.py:
python
AICOMMENTPROMPT =
分析此视频并生成评论。
话题:{topic}
您的自定义指南...
多设备
设置ANDROIDDEVICEID环境变量:
bash
ANDROIDDEVICEID=device1 python3 tiktok_bot.py search --topics fitness --videos 5
或使用--device标志:
bash
python3 tiktok_bot.py search --topics fitness --videos 5 --device device1
包含文件
tiktok-android-bot/
├── SKILL.md # 本文件
├── README.md # 完整文档
├── setup.py # 交互式设置向导
├── tiktok_bot.py # 主脚本(CLI)
├── config.example.py # 示例配置
├── requirements.txt # Python依赖
├── scripts/
│ ├── runfullcampaign.py # 旧版:25视频活动
│ └── runcompletesession.py # 旧版:3视频会话
├── src/
│ ├── bot/android/
│ │ ├── tiktokandroidbot.py # 核心自动化
│ │ └── tiktok_navigation.py # 导航流程
│ ├── ai_comments.py # AI评论生成
│