prod-FARM-IOS-Core README

The project's README from github.com/Git-Agni/prod-FARM-IOS-Core. As one markdown file: README.md.

Phone Farm iOS

An open-source, standalone application for operating physical iOS devices and running scheduled TikTok workflows. It includes guided device registration, WDA/Appium supervision, live video and remote input, PostgreSQL-backed scheduling, recurring jobs, uploads, execution history, the dashboard/API server, and a built-in TikTok automation plugin.

It runs locally as-is; authentication is optional on a loopback bind. Harden it for a shared or exposed deployment by supplying your own AuthProvider (PHONE_FARM_AUTH_PLUGIN) and process supervision — no fork required. Tasks are persisted as pluginId, taskType, taskVersion, and a JSON payload, so an old schedule can never silently execute a new contract.

Live demo and setup walkthrough: gethandler.ai/ios-farm

The full engineering writeup, TikTok on 9 real iPhones reverse engineered from the screen up (Apple's test daemon, the two WebDriverAgent patches, pixel-level UI detection, OCR account switching, never posting twice): gethandler.ai/tiktok-iphone-farm

Documentation

Run the standalone application

Requirements are Node 22+, PostgreSQL, Xcode, a signed real-device WebDriverAgent, and Appium's XCUITest driver.

npm install
cp .env.example .env
npm run appium:install-driver
npm run db:up
npm run db:migrate
npm run wda:prepare

Run these long-lived processes (wrap each in a launchd agent or systemd unit for an always-on host):

npm run appium
npm run wda:service
npm run worker
npm run web

TikTok support is enabled by default. Set PHONE_FARM_PLUGINS to comma-separated ESM package names to add more task plugins. Set PHONE_FARM_AUTH_PLUGIN to an ESM authentication provider before binding WEB_HOST outside loopback; startup deliberately fails otherwise.

Plugin contract

src/plugin.ts defines the stable interfaces. A plugin can provide versioned tasks, registration checks, device-page panels, namespaced HTTP routes, and declared WDA extensions. Task execution receives the exact device, that plugin's own per-device data, resolved assets, a temporary workspace, cancellation, durable logging, safe device primitives, and an observed subprocess runner.

See PLUGIN_DEVELOPMENT.md for compatibility and trust rules.

src/example-plugin.ts is a minimal open-app plugin. Production plugins should be separate packages and should never require changes to core routing or scheduler code.

Repository policy

This repository uses GitHub-hosted CI only. Never connect production devices, Apple signing material, production databases, self-hosted runners, or deployment credentials to workflows triggered by pull requests. See SECURITY.md.

npm run check

prod-FARM-IOS-Core (Git-Agni/prod-FARM-IOS-Core)

Searching Database…

这是什么?一个开源、自托管的应用,从一台 Mac 管理一批真实的物理 iPhone:提供引导式设备注册、实时视频/远程控制、基于 PostgreSQL 的调度,以及内置的 TikTok 自动化插件。
这是我用来构建的框架,还是开箱即跑的应用?它是一个带仪表盘/API 服务器和插件系统的独立应用,不是你导入的库——你把它作为一组长期运行的服务器进程来运行,并通过插件来扩展。
怎么把它跑起来?安装 Node 22+、PostgreSQL、Xcode、已签名的真机 WebDriverAgent 构建以及 Appium 的 XCUITest 驱动,然后运行 Appium、WDA 服务和仪表盘/API 进程(用 launchd 或 systemd 单元封装),并按照 docs/getting-started.md 注册一台设备。
我需要真实的 iPhone 和 Apple 开发者工具,还是可以用模拟器测试?你需要真实的、已签名的物理设备——安装要求 Xcode、已签名的真机 WebDriverAgent 构建以及 Appium 的 XCUITest 驱动;文档没有描述任何模拟器途径。
把仪表盘暴露到本地网络之外安全吗?开箱并不安全——在回环绑定上身份验证是可选的,而且如果你尝试绑定到回环之外却没有提供自己的 AuthProvider 和进程监管,启动会故意失败。
我是把它跑在 iPhone 本身上,还是跑在控制它们的 Mac 上?它运行在 Mac 上,由 Mac 通过 WDA/Appium 监管并远程控制已连接的物理 iPhone——手机是被管理的设备,而不是宿主机。
这和使用 iOS 模拟器有什么不同?它通过 Apple 的测试守护进程和修补过的 WebDriverAgent 构建来操控真实的物理 iPhone,而不是模拟器,因为 TikTok 工作流依赖真机行为。
它开箱自带 TikTok 自动化吗?自带。内置的 TikTok 自动化插件默认启用,包括基于 OCR 的账号切换,以及避免重复发布相同内容的逻辑。
我可以编写自己的自动化插件吗?可以。src/plugin.ts 为版本化任务、注册检查、设备页面面板和带命名空间的 HTTP 路由定义了稳定接口;生产环境的插件应当作为独立的包发布。
它如何避免旧的计划意外执行不匹配的任务?任务持久化时带有 pluginId、taskType、taskVersion 和一个 JSON 载荷,因此过期的计划绝不可能悄悄地针对不兼容的较新任务契约执行。
Creator
Git-Agni
Size
0.2 MB
Stars
1.7K
Updated
CommitSep 07
Age
1mo
Commits · 90 Days