{"id":19974,"date":"2024-01-05T11:06:24","date_gmt":"2024-01-05T03:06:24","guid":{"rendered":"https:\/\/www.zhidianwl.com\/zhidian\/?p=19974"},"modified":"2024-01-05T11:06:24","modified_gmt":"2024-01-05T03:06:24","slug":"termux%e5%bc%80%e5%8f%91%e5%ae%89%e5%8d%93app%e5%8f%af%e8%a1%8c%e5%98%9b","status":"publish","type":"post","link":"https:\/\/www.zhidianwl.com\/zhidian\/2024\/19974\/","title":{"rendered":"termux\u5f00\u53d1\u5b89\u5353app\u53ef\u884c\u561b"},"content":{"rendered":"

Termux\u662f\u4e00\u6b3eAndroid\u7cfb\u7edf\u4e0a\u7684\u7ec8\u7aef\u6a21\u62df\u5668\uff0c\u53ef\u4ee5\u5728\u5b89\u5353\u7cfb\u7edf\u4e2d\u4f7f\u7528Linux\u547d\u4ee4\u884c\u73af\u5883\uff0c\u652f\u6301\u901a\u8fc7\u5b89\u88c5\u8f6f\u4ef6\u5305\uff08apt package manager\uff09\u5b89\u88c5\u4e00\u4e9b\u7c7b\u4f3c\u4e8eUbuntu Linux\u7684\u8f6f\u4ef6\u5305\u3002\u901a\u8fc7Termux\u4f60\u53ef\u4ee5\u5728Android\u7cfb\u7edf\u4e0a\u5f00\u53d1\u7edd\u5927\u90e8\u5206\u7684Linux\u5e94\u7528\u7a0b\u5e8f\u3002\u5b89\u5353app\u5f00\u53d1\u5de5\u5177<\/a><\/p>\n

\u8981\u5728Termux\u4e0a\u5f00\u53d1\u5b89\u5353\u5e94\u7528\uff0c\u53ef\u4ee5\u501f\u52a9\u51e0\u4e2a\u5176\u4ed6\u5de5\u5177\uff0c\u8fd9\u4e9b\u5de5\u5177\u90fd\u662f\u57fa\u4e8eTermux\u7684\u547d\u4ee4\u884c\u73af\u5883\u7684\u3002<\/p>\n

1.\u5b89\u88c5Node.js<\/p>\n

Node.js\u662f\u4e00\u79cd\u57fa\u4e8eChrome V8\u5f15\u64ce\u7684JavaScript \u8fd0\u884c\u73af\u5883\u3002\u501f\u52a9Node.js\u4f60\u53ef\u4ee5\u5728Termux\u4e0b\u4f7f\u7528JavaScript\u5f00\u53d1Android\u5e94\u7528\u3002\u5728Termux\u4e2d\u901a\u8fc7apt\u5b89\u88c5Node.js\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

“`$ apt update<\/p>\n

$ apt install nodejs<\/p>\n

“`<\/p>\n

2.\u5b89\u88c5React Native<\/p>\n

React Native\u662f\u4e00\u4e2a\u57fa\u4e8eReact\u7684\u5f00\u6e90\u6846\u67b6\uff0c\u53ef\u4ee5\u4f7f\u7528JavaScript\u7f16\u5199\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u3002React Native\u53ef\u4ee5\u5728Android\u3001iOS\u548cWeb\u4e0a\u8fd0\u884c\u3002\u8981\u5728Termux\u4e2d\u5b89\u88c5React Native\uff0c\u9700\u8981\u4f7f\u7528npm\u5b89\u88c5\uff1a<\/p>\n

“`$ npm install -g react-native-cli<\/p>\n

“`<\/p>\n

3. \u5b89\u88c5Android SDK<\/p>\n

Android SDK\u662fAndroid\u5f00\u53d1\u7684\u8f6f\u4ef6\u5f00\u53d1\u5de5\u5177\u5305\uff0c\u5305\u62ecAndroid\u5f00\u53d1\u5de5\u5177\u3001Android SDK\u5e73\u53f0\u3001\u7cfb\u7edf\u6620\u50cf\u3001\u8c03\u8bd5\u5668\u3001\u6a21\u62df\u5668\u7b49\u591a\u4e2a\u5de5\u5177\u3002\u5728Termux\u4e2d\u5b89\u88c5Android SDK\u9700\u8981\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177sdkmanager\uff0c\u5b89\u88c5\u524d\u9700\u8981\u5148\u5b89\u88c5Java\u8fd0\u884c\u73af\u5883\uff1a<\/p>\n

“`$ apt update<\/p>\n

$ apt install openjdk-11-jdk-headless<\/p>\n

$ apt install wget<\/p>\n

$ mkdir ~\/usr<\/p>\n

$ cd ~\/usr<\/p>\n

$ wget https:\/\/dl.google.com\/android\/repository\/sdk-tools-linux-3859397.zip<\/p>\n

$ apt install unzip<\/p>\n

$ unzip sdk-tools-linux-*.zip sdk-tools\/<\/p>\n

$ rm sdk-tools-linux-*.zip<\/p>\n

$ export PATH=$PATH:~\/usr\/sdk-tools\/tools\/bin<\/p>\n

$ sdkmanager “\u5b89\u5353APP\u5f00\u53d1<\/a>platform-tools” “build-tools;26.0.0” “platforms;android-26” “extras;android;m2repository” “extras;google;m2repository”<\/p>\n

“`<\/p>\n

4. Clone\u4f60\u8981\u5f00\u53d1\u7684\u9879\u76ee\u5e76\u542f\u52a8<\/p>\n

\u5728Termux\u4e2d\u4f7f\u7528git clone\u547d\u4ee4\u514b\u9686\u4f60\u8981\u5f00\u53d1\u7684React Native\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u4f7f\u7528npm\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n

“`$ git clone https:\/\/github.com\/your-project.git<\/p>\n

$ cd your-project<\/p>\n

$ npm install<\/p>\n

$ react-native run-android<\/p>\n

“`<\/p>\n

\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u5c31\u53ef\u4ee5\u5728Termux\u547d\u4ee4\u884c\u4e0b\u5f00\u53d1Android\u5e94\u7528\u7a0b\u5e8f\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u7531\u4e8eTermux\u5e76\u4e0d\u662f\u4e00\u4e2a\u5b8c\u6574\u7684Android\u7cfb\u7edf\uff0c\u56e0\u6b64\u65e0\u6cd5\u63d0\u4f9b\u5b8c\u6574\u7684Android API\u63a5\u53e3\uff0c\u5982\u679c\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u4f7f\u7528\u7279\u5b9a\u7684Android\u786c\u4ef6\u6216API\uff0c\u9700\u8981\u5728Termux\u4e0a\u8fdb\u884c\u8de8\u5e73\u53f0\u6d4b\u8bd5\u548c\u8c03<\/p>\n

<\/figure>\n<\/p>\n

\u8bd5\uff0c\u6216\u8005\u4f7f\u7528\u5176\u4ed6Android\u5f00\u53d1\u5de5\u5177\u6765\u8fdb\u884c\u7f16\u8bd1\u548c\u6d4b\u8bd5\uff0c\u4f8b\u5982Android Studio\u548cEclipse\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Termux\u662f\u4e00\u6b3eAndroid\u7cfb\u7edf\u4e0a\u7684\u7ec8\u7aef\u6a21\u62df\u5668\uff0c\u53ef\u4ee5\u5728\u5b89\u5353\u7cfb\u7edf\u4e2d\u4f7f\u7528Linux\u547d\u4ee4\u884c\u73af\u5883\uff0c\u652f\u6301\u901a\u8fc7\u5b89\u88c5\u8f6f\u4ef6\u5305\uff08apt package manager\uff09\u5b89\u88c5\u4e00\u4e9b\u7c7b\u4f3c\u4e8eUbuntu Linux\u7684\u8f6f\u4ef6<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[625,25187,14,25186,345],"class_list":{"0":"post-19974","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-zuoapp","7":"tag-625","8":"tag-app","9":"tag-14","11":"tag-345"},"_links":{"self":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/19974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/comments?post=19974"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/19974\/revisions"}],"predecessor-version":[{"id":20027,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/19974\/revisions\/20027"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/media?parent=19974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/categories?post=19974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/tags?post=19974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}