{"id":1566,"date":"2024-08-15T11:30:48","date_gmt":"2024-08-15T03:30:48","guid":{"rendered":"https:\/\/aichh.com\/?p=1566"},"modified":"2024-08-15T11:37:15","modified_gmt":"2024-08-15T03:37:15","slug":"%e6%9e%84%e5%bb%baws-scrcpy-docker-%e9%95%9c%e5%83%8f-%e8%bf%9c%e7%a8%8bandroid%e6%89%8b%e6%9c%ba","status":"publish","type":"post","link":"https:\/\/aichh.com\/1566.html","title":{"rendered":"\u6784\u5efaws-scrcpy docker \u955c\u50cf \u8fdc\u7a0bandroid\u624b\u673a"},"content":{"rendered":"<!--wp-compress-html--><!--wp-compress-html no compression--><p>\u670d\u52a1\u5668\uff1aubuntu20<\/p>\n<p><strong>git\u514b\u9686\u6700\u65b0\u7684ws-scrcpy\u4ee3\u7801<\/strong><\/p>\n<pre>git clone https:\/\/github.com\/NetrisTV\/ws-scrcpy.git<\/pre>\n<p><strong>\u8fdb\u5165ws-scrcpy\u76ee\u5f55\u65b0\u5efaDockerfile\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b<\/strong><\/p>\n<pre>FROM node:16-alpine\r\nWORKDIR \/app\r\n\r\nRUN npm config set registry http:\/\/mirrors.cloud.tencent.com\/npm\/\r\nRUN npm install -g node-gyp\r\nRUN sed -i 's\/dl-cdn.alpinelinux.org\/mirrors.tuna.tsinghua.edu.cn\/g' \/etc\/apk\/repositories\r\nRUN apk add android-tools make g++\r\n\r\nCOPY . .\r\nRUN npm install\r\nRUN npm run dist\r\n\r\nEXPOSE 8000\r\nCMD [\"node\",\"dist\/index.js\"]<\/pre>\n<p><strong>\u6784\u5efaws-scrcpy\u955c\u50cf<\/strong><\/p>\n<pre>docker build -t ws-scrcpy .<\/pre>\n<p><strong>\u542f\u52a8ws-scrcpy\u5bb9\u5668<\/strong><\/p>\n<pre>docker run -d --name ws-scrcpy -p 8000:8000 ws-scrcpy<\/pre>\n<p><strong>\u542f\u52a8anroid 14\u6a21\u62df\u5668<\/strong><\/p>\n<pre>docker run -d --privileged -p 5555:5555 redroid\/redroid:14.0.0-latest<\/pre>\n<p><strong>ws-scrcpy\u8fde\u63a5android\u8bbe\u5907<\/strong><\/p>\n<pre>docker exec ws-scrcpy adb connect ip:5555<\/pre>\n<p><strong>\u6d4f\u89c8\u5668\u8bbf http:\/\/\u4e3b\u673aIP:8000\uff0c\u663e\u793a\u5982\u4e0b<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"2e46c186e5041085644c5029228205f1\" src=\"https:\/\/aichh.com\/wp-content\/uploads\/2024\/08\/2e46c186e5041085644c5029228205f1.png\" width=\"886\" height=\"160\">\u70b9\u51fb<strong>Broadway.js<\/strong>\u3001<strong>H264 Converter<\/strong>\u3001<strong>Tiny H264 <\/strong>\u9009\u4e00\u4e2a\u901f\u5ea6\u5feb\u7684\u8bbf\u95ee\u5373\u53ef<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p>https:\/\/hub.docker.com\/r\/redroid\/redroid<\/p>\n<p>https:\/\/github.com\/NetrisTV\/ws-scrcpy<\/p>\n<p>https:\/\/github.com\/scavin\/ws-scrcpy-docker<\/p>\n<p>https:\/\/github.com\/remote-android\/redroid-doc<\/p>\n<p>https:\/\/blog.imoeq.com\/scrcpy-run-a-android-web-page\/<\/p>\n<p>https:\/\/meta.appinn.net\/t\/topic\/33828<\/p>\n<p>https:\/\/github.com\/nodesource\/distributions\/blob\/master\/README.md<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p><strong>\u9644\uff1a<\/strong><\/p>\n<p>node.js 18.x\u4e00\u952e\u5b89\u88c5\u811a\u672c\uff0c\u6362\u7248\u672c\u5c31\u628a18.x\u6539\u621020.x\u3002<\/p>\n<pre>curl -fsSL https:\/\/deb.nodesource.com\/setup_18.x -o nodesource_setup.sh | sudo -E bash nodesource_setup.sh<\/pre>\n<p>\u5b89\u88c5node.js<\/p>\n<pre>sudo apt-get install -y nodejs<\/pre>\n<p>\u9a8c\u8bc1\u5b89\u88c5<\/p>\n<pre>node -v<\/pre>\n<!--wp-compress-html no compression--><!--wp-compress-html-->","protected":false},"excerpt":{"rendered":"\u670d\u52a1\u5668\uff1aubuntu20 git\u514b\u9686\u6700\u65b0\u7684ws-scrcpy\u4ee3\u7801 git clone https:\/\/github.com\/NetrisTV\/ws-scrcpy.git \u8fdb\u5165ws-scrcpy\u76ee\u5f55\u65b0\u5efa \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[173,315,412],"class_list":["post-1566","post","type-post","status-publish","format-standard","hentry","category-jiaocheng","tag-git","tag-scrcpy","tag-ws"],"views":654,"_links":{"self":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/1566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/comments?post=1566"}],"version-history":[{"count":4,"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/1566\/revisions"}],"predecessor-version":[{"id":1571,"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/1566\/revisions\/1571"}],"wp:attachment":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/media?parent=1566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/categories?post=1566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/tags?post=1566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}