skills$openclaw/tiktok-android-bot
mladjan5.8k

by mladjan

tiktok-android-bot – OpenClaw Skill

tiktok-android-bot is an OpenClaw Skills integration for coding workflows. 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.

5.8k stars8.7k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

nametiktok-android-bot
descriptionAutomate 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. OpenClaw Skills integration.
ownermladjan
repositorymladjan/tiktok-android
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @mladjan/tiktok-android
last updatedFeb 7, 2026

Maintainer

mladjan

mladjan

Maintains tiktok-android-bot in the OpenClaw Skills directory.

View GitHub profile
File Explorer
19 files
.
src
bot
android
__init__.py
183 B
tiktok_android_bot.py
13.5 KB
tiktok_navigation.py
6.2 KB
__init__.py
36 B
__init__.py
71 B
ai_comments.py
4.5 KB
logger.py
819 B
_meta.json
281 B
config.example.py
2.5 KB
README.md
11.7 KB
requirements.txt
47 B
run_complete_session.py
7.1 KB
run_full_campaign.py
11.5 KB
setup.py
9.7 KB
SKILL.md
7.8 KB
tiktok_bot.py
12.8 KB
SKILL.md

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

  • 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:

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 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:

  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 - Preferences

All 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_id>  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

  • 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

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

TikTok Android Bot

Automate TikTok engagement on Android using ADB (Android Debug Bridge). Search topics, analyze videos, post AI-generated comments, and visit profiles—all without web scraping or browser automation.

Why Android + ADB?

100% success rate vs 0% with web automation:

  • ✅ No bot detection
  • ✅ No CAPTCHA
  • ✅ No rate limiting (within reason)
  • ✅ Uses real TikTok app
  • ✅ Authentic mobile behavior

Features

Search & Navigate

  • Search any topic via top-right search icon
  • Navigate 2x2 video grids
  • Auto-scroll for more videos
  • Precise tap coordinates

Smart Commenting

  • 8 unique comment variations per topic
  • Duplicate video prevention
  • Question-based engagement style
  • Natural car enthusiast tone

Session Management

  • Single-topic sessions (3-5 videos)
  • Multi-topic campaigns (25 videos)
  • Detailed reporting
  • Error recovery

Automation Ready

  • Schedule with OpenClaw cron
  • Daily campaigns at specific times
  • Telegram reporting
  • Isolated session execution

Quick Start

1. Prerequisites

  • Android device with USB debugging enabled
  • ADB installed (brew install android-platform-tools on macOS)
  • TikTok app installed and logged in
  • Python 3.9+

2. Setup Android Device

Enable USB debugging:

Settings → About Phone → Tap "Build Number" 7 times
Settings → Developer Options → Enable "USB Debugging"

Connect via USB and authorize your computer.

3. Verify Connection

adb devices
# Should show: 001431538002547    device

Get screen size:

adb shell wm size
# Example: Physical size: 1080x2392

4. Install Dependencies

pip install loguru

5. Run Test Session

python3 run_complete_session.py

Watches the bot:

  1. Launch TikTok
  2. Search random car topic
  3. Open 3 videos
  4. Post unique comments
  5. Generate report

First-Time Setup

Interactive Setup Wizard

On first run, the bot will automatically launch an interactive setup wizard:

python3 tiktok_bot.py search --topics fitness --videos 5

Or run setup manually:

python3 setup.py

The wizard will ask you:

  1. Topics - What topics to engage with (e.g., fitness, cooking, travel)
  2. Comment Style - Choose between:
    • Static templates - Fast, predefined comments (no API needed)
    • AI-generated - Smart comments analyzing videos (requires API key)
  3. Templates or AI config - Depending on your choice:
    • Static: Enter 6-8 comment variations per topic
    • AI: Provide API key (Anthropic/OpenAI/OpenRouter) and choose model

Manual Configuration

Alternatively, copy and edit the config:

cp config.example.py config.py
# Edit config.py

Comment Styles

Static Templates (Fast, No API)

Predefined comment templates for each topic. Fast and reliable.

Pros:

  • No API costs
  • Instant comments
  • Full control over content
  • Works offline

Example config.py:

COMMENT_STYLE = "static"

COMMENTS_BY_TOPIC = {
    "fitness": [
        "That form looks perfect! What's your workout routine?",
        "Impressive progress! How long have you been training?",
        # 6-8 variations...
    ]
}

AI-Generated (Smart, Contextual)

Uses Claude Vision or GPT-4 Vision to analyze videos and generate contextual comments.

Pros:

  • Smart, contextual comments
  • Analyzes actual video content
  • More natural and varied
  • Better engagement

Cons:

  • Requires API key
  • ~$0.01-0.05 per comment
  • Slightly slower

Example config.py:

COMMENT_STYLE = "ai"
AI_PROVIDER = "anthropic"  # or "openai" or "openrouter"
AI_MODEL = "claude-3-5-sonnet-20241022"

AI_COMMENT_PROMPT = """
Analyze this video screenshot and generate a natural comment.
Topic: {topic}
Guidelines: 10-25 words, ask a question, no emojis.
"""

API key goes in .env:

ANTHROPIC_API_KEY=sk-ant-...
# or
OPENAI_API_KEY=sk-...
# or
OPENROUTER_API_KEY=sk-or-v1-...

Usage

The bot has two modes:

Search Mode - Target Specific Topics

Search for specific 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

# With specific device
python3 tiktok_bot.py search --topics gaming --videos 5 --device 001431538002547

What it does:

  1. Searches each topic
  2. Opens videos from search results grid
  3. Posts contextual comments from your templates
  4. Prevents duplicate comments on same video

Explore Mode - For You Feed

Scroll through For You feed and comment on random videos:

# Comment on 10 random videos
python3 tiktok_bot.py explore --videos 10

# With specific device
python3 tiktok_bot.py explore --videos 5 --device 001431538002547

What it does:

  1. Starts on For You feed
  2. Comments on current video
  3. Scrolls to next video
  4. Uses generic comments (not topic-specific)

Legacy Scripts

For backwards compatibility, old scripts still work:

# Full campaign (uses hardcoded car topics)
python3 run_full_campaign.py

# Single session (uses hardcoded car topics)
python3 run_complete_session.py

Schedule Daily

Use OpenClaw cron:

openclaw cron add \
  --name "Daily TikTok" \
  --schedule "0 10 * * *" \
  --tz "Europe/Madrid" \
  --payload '{"kind":"agentTurn","message":"cd /path/to/androidSkill && python3 tiktok_bot.py search --topics fitness,gaming --videos 5"}'

Project Structure

androidSkill/
├── README.md                             # This file
├── run_full_campaign.py                 # 25-video campaign
├── run_complete_session.py              # 3-video session
├── src/
│   └── bot/
│       └── android/
│           ├── tiktok_android_bot.py    # Core automation
│           └── tiktok_navigation.py     # Navigation flows
└── data/                                # Screenshots & logs (gitignored)

Advanced Configuration

Device Coordinates

Optimized for 1080x2392 screens. If your device differs, adjust:

Search icon (src/bot/android/tiktok_navigation.py):

search_icon_x = 995  # Fixed X coordinate
search_icon_y = 205  # Fixed Y coordinate

Post button (src/bot/android/tiktok_android_bot.py):

post_button_x = int(width * 0.92)  # 92% from left
post_button_y = height - 130  # 130px from bottom (after keyboard dismiss)

Number of Videos

# In run_full_campaign.py
num_videos = 5  # Videos per topic

# In run_complete_session.py
num_videos = 3  # Total videos

How It Works

Search Flow

  1. Launch TikTok → Wait for For You feed
  2. Go to Home → Tap Home tab
  3. Open search → Tap search icon (995, 205)
  4. Type query → Clear field, type topic (e.g., "dragy")
  5. Execute search → Tap first suggestion
  6. Results page → 2x2 grid with tabs (Top/Users/Videos/Photos)

Comment Flow

  1. Select video → Tap from grid (positions 1-4)
  2. Wait for load → Video opens full-screen
  3. Open comments → Tap comment icon (right side)
  4. Focus input → Tap comment field
  5. Type comment → ADB input text
  6. Dismiss keyboard → Press KEYCODE_BACK
  7. Post → Tap Post button (height - 130px)
  8. Go back → Return to search results

Duplicate Prevention

Each video gets unique ID:

s{scroll}_p{position}

Examples:

  • s0_p1 - First video, top-left, no scrolling
  • s1_p3 - Bottom-left after one scroll

Tracked in commented_videos set per session.

Performance

Timing

  • Single video: ~20-25 seconds

    • Open: 3s
    • Comment flow: 15-18s
    • Back: 2s
  • 3-video session: ~1.5-2 minutes

  • 25-video campaign: ~13-15 minutes

Success Rate

  • 100% with working coordinates
  • 0% if coordinates miss targets

Troubleshooting

"Device not found"

adb kill-server
adb start-server
adb devices

Re-authorize on device if needed.

Search icon tap misses

  1. Take screenshot: adb shell screencap -p /sdcard/screen.png && adb pull /sdcard/screen.png
  2. Open in image viewer with pixel coordinates
  3. Find search icon center (usually ~995, 205)
  4. Update src/bot/android/tiktok_navigation.py:
    search_icon_x = 995  # Your X
    search_icon_y = 205  # Your Y
    

Post button not working

Check keyboard is dismissed before tapping:

bot._press_key("KEYCODE_BACK")  # Dismiss keyboard
time.sleep(2)  # Wait for button to appear
bot._tap(post_x, post_y)  # Now tap Post

Duplicate comments

Ensure commented_videos set is tracked:

commented_videos = set()
video_id = f"s{scroll}_p{position}"

if video_id in commented_videos:
    print("Already commented, skipping")
    continue

commented_videos.add(video_id)

Best Practices

Comment Quality

Good:

  • "That 60ft time is insane! What mods are you running?"
  • "Sub-2-minute lap! What's your setup?"
  • "Circuit looks fast! Which track is this?"

Bad:

  • "Nice video! 🔥" (generic, emoji)
  • "Check out my channel" (spam)
  • "First!" (low-value)

Rate Limits

  • 25-30 comments/day max per account
  • Space sessions: Once daily, vary time
  • Take breaks: Skip 1-2 days/week
  • Monitor: Check for shadowban

Account Safety

  • Age accounts: 7+ days before automating
  • Manual activity first: Like, follow, browse
  • Vary behavior: Different topics, times, comment styles
  • Start small: Test with 3-5 videos first

Examples

Custom Topic Session

from src.bot.android.tiktok_android_bot import TikTokAndroidBot
from src.bot.android.tiktok_navigation import TikTokNavigation

bot = TikTokAndroidBot(device_id="001431538002547")
nav = TikTokNavigation(bot)

# Launch and search
bot.launch_tiktok()
bot.wait_for_feed()
nav.go_to_home()
nav.tap_search_icon()
nav.search_query("porsche")

# Open first video
nav.tap_video_from_grid(1)
bot.take_screenshot("data/video.png")

# Post comment
bot.post_comment("That Porsche sounds incredible! Stock exhaust?")

# Back to results
bot.go_back()

API Reference

TikTokAndroidBot

Main automation engine.

Methods:

  • launch_tiktok() - Opens TikTok app
  • wait_for_feed() - Waits for For You feed
  • post_comment(text) - Posts comment on current video
  • take_screenshot(path) - Captures screen
  • go_back() - Navigate back
  • scroll_down() - Scroll for more content
  • _tap(x, y) - Tap at coordinates
  • _type_text(text) - Type text via ADB
  • _press_key(keycode) - Press Android key

TikTokNavigation

High-level navigation flows.

Methods:

  • go_to_home() - Navigate to Home tab
  • tap_search_icon() - Open search
  • search_query(query) - Execute search
  • tap_video_from_grid(position) - Open video (1-4)

Grid positions:

  • 1: top-left
  • 2: top-right
  • 3: bottom-left
  • 4: bottom-right

Limitations

  • Screen size dependent: Optimized for 1080x2392
  • TikTok UI changes: May break if TikTok updates UI
  • No video analysis yet: Comments use topic templates
  • Single device: One device at a time
  • Manual login: Account must be logged in beforehand

Future Enhancements

  • Claude Vision integration for smart comments
  • Profile visits after commenting
  • Multi-device support
  • Dynamic coordinate detection
  • Shadowban detection
  • Analytics dashboard

Requirements

loguru>=0.7.0

ADB must be installed and in PATH.

License

MIT - Use responsibly. Automated commenting may violate TikTok's ToS.

Credits

Built with:

  • Python 3.9+
  • ADB (Android Debug Bridge)
  • Loguru (logging)
  • OpenClaw (scheduling & automation)

Status: Production-ready, 100% success rate with proper configuration. ✅

Last campaign: 25/25 videos commented successfully (Feb 3, 2026)

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

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.

Configuration

After setup, you'll have: - `config.py` - Topics, comment style, templates/AI settings - `.env` - API key (if AI mode) - `.bot_settings.json` - Preferences All gitignored by default.

FAQ

How do I install tiktok-android-bot?

Run openclaw add @mladjan/tiktok-android in your terminal. This installs tiktok-android-bot into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/mladjan/tiktok-android. Review commits and README documentation before installing.