首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >仅限于本机构建(android)

仅限于本机构建(android)
EN

Stack Overflow用户
提问于 2018-10-19 15:39:57
回答 2查看 2.9K关注 0票数 2

场景

我使用react-native run-android来构建我的安卓项目,但它也运行这个项目。因为我使用npm插件来修改我的构建信息,所以我只对构建而不是启动感兴趣。

问题

有了react本机,可以在不启动的情况下构建android文件吗?理论上类似于react-native build-androidreact-native run-android --build-only

额外信息

我查看了help for react-native run-android,但没有看到任何有希望的地方。

代码语言:javascript
复制
$ react-native run-android --help
Scanning folders for symlinks in /Users/Jackson/Sites/fnmultiapptest/node_modules (11ms)

  react-native run-android [options]
  builds your app and starts it on a connected Android emulator or device

  Options:

    --install-debug           
    --root [string]           Override the root directory for the android build (which contains the android directory) (default: "")
    --flavor [string]         --flavor has been deprecated. Use --variant instead
    --variant [string]        
    --appFolder [string]      Specify a different application folder name for the android source. (default: "app")
    --appId [string]          Specify an applicationId to launch after build. (default: "")
    --appIdSuffix [string]    Specify an applicationIdSuffix to launch after build. (default: "")
    --main-activity [string]  Name of the activity to start (default: "MainActivity")
    --deviceId [string]       builds your app and starts it on a specific device/simulator with the given device id (listed by running "adb devices" on the command line).
    --no-packager             Do not launch packager while building
    --port [number]            (default: 8081)
    --config [string]         Path to the CLI configuration file
    -h, --help                output usage information
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-10-19 16:58:32

导航到android目录并运行./gradlew assembleDebug。然后可以手动安装。

票数 3
EN

Stack Overflow用户

发布于 2018-10-19 16:53:14

也许只有:

代码语言:javascript
复制
cd android && ./gradlew build -x lint 

(如果在windows上运行gradlew.bat )

https://github.com/facebook/react-native/blob/master/local-cli/runAndroid/runAndroid.js#L180

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52895736

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档