Socket
Socket
Sign inDemoInstall

@react-native-community/cli-platform-android

Package Overview
Dependencies
108
Maintainers
30
Versions
194
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @react-native-community/cli-platform-android

This package is part of the [React Native CLI](../../README.md). It contains commands for managing the Android part of React Native app.


Version published
Weekly downloads
2.1M
increased by2.12%
Maintainers
30
Created
Weekly downloads
 

Package description

What is @react-native-community/cli-platform-android?

The @react-native-community/cli-platform-android package is a part of the React Native CLI which provides tools and utilities for managing and building React Native applications for the Android platform. It includes commands for building APKs, linking native modules, and more, tailored specifically for Android development within a React Native context.

What are @react-native-community/cli-platform-android's main functionalities?

Building APKs

This command is used to compile the React Native app and build an APK for Android. It can be used for both debugging and release builds.

npx react-native run-android

Linking native modules

Automatically links native module dependencies for Android by updating the necessary Android configuration files.

npx react-native link [package-name]

Starting the Metro bundler

Starts the Metro bundler which is used to compile the JavaScript code of the React Native app.

npx react-native start

Other packages similar to @react-native-community/cli-platform-android

Readme

Source

@react-native-community/cli-platform-android

This package is part of the React Native CLI. It contains commands for managing the Android part of React Native app.

Installation

yarn add @react-native-community/cli-platform-android

Commands

run-android

Usage:

npx react-native run-android [options]

Builds your app and starts it on a connected Android emulator or device.

Options
--appId <string>

Specify an applicationId to launch after build. If not specified, package from AndroidManifest.xml will be used.

--appIdSuffix <string>

Specify an applicationIdSuffix to launch after build.

--main-activity <string>

default: 'MainActivity'

Name of the activity to start.

--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: process.env.RCT_METRO_PORT || 8081

--terminal <string>

default: process.env.REACT_TERMINAL || process.env.TERM_PROGRAM

Launches the Metro Bundler in a new window using the specified terminal path.

--tasks <list>

default: 'installDebug'

Run custom gradle tasks. If this argument is provided, then --mode option is ignored. Example: yarn react-native run-android --tasks clean,installDebug.

--active-arch-only

default: false

Build native libraries only for the current device architecture for debug builds.

--list-devices

default: false

List all available Android devices and simulators and let you choose one to run the app.

--interactive

Manually select a task and device/simulator you want to run your app on.

[!WARNING]
This flag is running ./gradlew tasks under the hood, which might take some time for more complex apps. If that affects your project, consider using --mode and --deviceId flags instead.

build-android

Usage:

npx react-native build-android [options]

Builds Android app.

Options
--mode <string>

default: debug

Mode to build the app. Either 'debug' (default) or 'release'.

--extra-params <string>

Custom params that will be passed to gradle build command. Example:

npx react-native build-android --extra-params "-x lint -x test"
--binary-path <path>

Installs passed binary instead of building a fresh one. This command is not compatible with --tasks.

--user <number | string>

Id of the User Profile you want to install the app on.

log-android

Usage:

npx react-native log-android

Starts logkitty displaying pretty Android logs.

FAQs

Last updated on 18 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc