{"id":13621664,"url":"https://github.com/openatx/atxserver2","last_synced_at":"2025-04-15T01:33:31.741Z","repository":{"id":42188001,"uuid":"165815646","full_name":"openatx/atxserver2","owner":"openatx","description":"Smart Phone Management. Reimplement of atx-server with Python","archived":true,"fork":false,"pushed_at":"2023-03-28T07:30:06.000Z","size":1668,"stargazers_count":1357,"open_issues_count":64,"forks_count":424,"subscribers_count":50,"default_branch":"master","last_synced_at":"2024-11-08T08:41:47.512Z","etag":null,"topics":["atx","platform","smartphone"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openatx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-15T08:42:33.000Z","updated_at":"2024-11-07T12:01:32.000Z","dependencies_parsed_at":"2024-01-14T06:04:07.112Z","dependency_job_id":"ccc9c871-9ac7-450c-ad77-168939a1b4f4","html_url":"https://github.com/openatx/atxserver2","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openatx%2Fatxserver2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openatx%2Fatxserver2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openatx%2Fatxserver2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openatx%2Fatxserver2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openatx","download_url":"https://codeload.github.com/openatx/atxserver2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248989438,"owners_count":21194586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atx","platform","smartphone"],"created_at":"2024-08-01T21:01:09.327Z","updated_at":"2025-04-15T01:33:31.317Z","avatar_url":"https://github.com/openatx.png","language":"HTML","readme":"## atxserver2\n移动设备管理平台(支持Android和iOS), 欢迎加入QQ群交流\n\n![image-20190619180012756](docs/qq.png)\n\n![img](static/favicon-dark.png)\n\n## 部署方案1 （docker-compose方式）\n代码Clone到本地\n\n接下来切换到代码目录，只需要再执行一条命令即可。\n\n```bash\ndocker-compose up\n```\n\n## 部署方案2 （手动部署）\n**Step 1**\n\n先准备好一个rethinkdb服务器(推荐部署到Linux上) 具体方法查看[RethinkDB安装文档](https://rethinkdb.com/docs/install/)\n\n**Step 2**\n\n安装并启动Server，这里需要Python3.6以上版本\n\n先将代码clone到本地，使用下面的方法安装依赖\n\n```bash\npip3 install -r requirements.txt\n```\n\n最简单的启动方法 （默认连接的rethinkdb地址 `localhost:28015`)\n\n```bash\n# 启动方式，这也是最简单的启动方法\npython3 main.py\n\n# 指定认证方式\npython3 main.py --auth simple # 默认是一个非常simple的认证，输入邮箱就可以\npython3 main.py --auth openid # 网易内部使用\npython3 main.py --auth github # github 认证, 需要在 `settings.py` 里面配置 `client_id` 和 `client_secret` 相关信息\n# 其他的认证方式还有待添加，非常欢迎PR\n\n# 设置监听端口\npython3 main.py --port 4000 # 默认监听的就是这个地址\n\n# 默认支持运行在Nginx下，支持 X-Real-Ip/X-Forwarded-For\n# 如果不需要可以通过 --no-xheaders 关闭该功能\n```\n\n通过环境变量的修改，可以更改RethinkDB的连接地址\n\n```bash\n# Linux环境\n# the bellow is default value\nexport RDB_HOST=localhost\nexport RDB_PORT=28015\nexport RDB_USER=admin\nexport RDB_PASSWD=\nexport RDB_DBNAME=atxserver2\n\npython3 main.py\n```\n\n启动之后，浏览器打开 \u003chttp://localhost:4000\u003e，完成认证之后就可以顺利的看到设备列表页了。不过目前还是空的，什么都没有。\n\n![image](https://user-images.githubusercontent.com/3281689/54806497-1a90ce80-4cb5-11e9-84c5-bbb4f427cbd5.png)\n\n**Step 3: Android设备接入**\n\n接下来，进行安卓设备接入。这时需要用到另外一个项目 [atxserver2-android-provider](https://github.com/openatx/atxserver2-android-provider)\n这个项目运行需要Python3.6+和NodeJS\n\n如果你用的是Linux系统，推荐使用Docker部署，其他平台需要用源码部署，具体请参考文档 [atxserver2-android-provider](https://github.com/openatx/atxserver2-android-provider)\n\n```bash\nSERVER_URL=\"http://10.0.0.1:4000\" # 这个修改成自己的atxserver2地址\nIMAGE=\"codeskyblue/atxserver2-android-provider\"\ndocker pull $IMAGE\ndocker run --rm --privileged -v /dev/bus/usb:/dev/bus/usb --net host \\\n    ${IMAGE} python main.py --server ${SERVER_URL}\n```\n\n该镜像会把所有必要的资源 （atx-uiautomator.apk, minicap, minitouch, atx-agent) 全部推送到手机上。\n一切就绪后，你可以进行远程真机的操作了。\n\n![atxserver2-remotecontrol](https://user-images.githubusercontent.com/3281689/54807405-187c3f00-4cb8-11e9-8a8e-8092c5472dc1.gif)\n\n**Step 3: iOS设备接入**\n\n参考项目介绍 [atxserver2-ios-provider](https://github.com/openatx/atxserver2-ios-provider)\n\n### 私有设备接入（Beta）\n目前只实现了Android\n\n`atxserver2-android-provider`启动的时候可以通过传递参数 `--owner=xingxing` 声明该provider所有连接的设备属于`xingxing`这个组所有，或者`--owner=panpan@gmail.com` 声明为panpan个人所有\n\n通过点击导航栏的下拉菜单，点击`用户信息`,在这个标签页下可以获取个人的token，也可以进行组的管理。（目前还没有组成员管理的功能）\n\n## 管理员功能\n默认第一个登录的用户会成为管理员\n\n管理员有哪些特权呢？\n\n1. 可以释放他人正在使用的设备。（按住ALT，然后双击`正在使用`按钮）\n2. 使用他人的身份占用设备（参考API文档）\n3. 获取设备的source信息（参考API文档）\n4. 将他人设置为管理员，导航栏可以看到`后台管理`链接\n5. 有权修改`资产编号`字段\n\n## 操作指南\n鼠标操作\n\n- Right-Click: BACK\n- Middle-Click: HOME\n\n## Developers\n目前采用tornado+rethinkdb\n\n目录结构参考了django, 代码绝大多数都用到的`async`的功能\n\n```\n|-- static  静态目录\n|-- templates 前端界面\n|-- web  网页代码\n      |-- urls.py 路由整合文件\n      |-- settings.py 配置文件\n      |-- database.py 数据库操作相关\n      |-- utils.py 常用配置\n      |-- views 每个界面的逻辑\n        |-- slave.py 与atxslave通信用\n        |-- device.py 设备相关路由\n        |-- base.py 基于RequestHandler的基类\n```\n\n## 接口\n详情点击 接口[REST API](API.md)\n\nExamples:\n\n- [Install app and run uiautomator2 test](examples/android_test.py)\n\n## Thanks\n- \u003chttps://github.com/openstf\u003e\n- \u003chttps://github.com/Genymobile/scrcpy\u003e\n- [https://www.easyicon.net](https://www.easyicon.net/iconsearch/hub/)\n- \u003chttps://github.com/mikusjelly/apkutils\u003e\n- \u003chttps://github.com/gtsystem/python-remotezip\u003e\n- \u003chttps://github.com/willerce/WhatsInput\u003e\n\n## 微信打赏\n以前我一直对打赏这种行为不屑一顾，但真正的收到社区成员千翻百计找到我的打赏码打赏的时候还是很开心，感觉工作得到的人认可，很开心。我也有时候会打赏别人，让激动的心情有了发泄的出口。\n请不要打赏太多，知道了你们的心意就好了。我将会用收到的money通通拿来去楼下咖啡店买咖啡，买饮料。^_^\n\n![wechat](docs/wechat_qrcode.jpg)\n\n## LICENSE\n[MIT](LICENSE)\n","funding_links":[],"categories":["云测平台","HTML"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenatx%2Fatxserver2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenatx%2Fatxserver2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenatx%2Fatxserver2/lists"}