![Meet Socket at BlackHat and DEF CON in Las Vegas](https://cdn.sanity.io/images/cgdhsj6q/production/4a3876139ffd3878bb3e7800a14cf4044245dca7-1080x834.jpg?w=400&fit=max&auto=format)
Security News
Meet Socket at BlackHat and DEF CON in Las Vegas
Come meet the Socket team at BlackHat and DEF CON! We're sponsoring some fun networking events and we would love to see you there.
@react-native-community/cli-platform-android
Advanced tools
Package description
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.
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
The react-native-cli package is a global command-line utility that allows you to perform various tasks such as initializing a new React Native project. It is less focused on platform-specific tasks compared to @react-native-community/cli-platform-android.
Expo CLI is a command-line app that is the main interface between a developer and Expo tools. While it provides similar functionalities for building and testing React Native apps, it is tailored for use with the Expo ecosystem, which abstracts away much of the native Android and iOS build process.
Apache Cordova is a mobile development framework that allows you to use standard web technologies to build cross-platform mobile applications. It provides a CLI for creating, building, and managing Cordova projects, which is similar in scope to @react-native-community/cli-platform-android but for the Cordova ecosystem.
Readme
This package is part of the React Native CLI. It contains commands for managing the Android part of React Native app.
yarn add @react-native-community/cli-platform-android
run-android
Usage:
react-native run-android [options]
Builds your app and starts it on a connected Android emulator or device.
--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 --variant
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.
build-android
Usage:
react-native build-android [options]
Builds Android app.
--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:
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:
react-native log-android
Starts logkitty
displaying pretty Android logs.
FAQs
This package is part of the [React Native CLI](../../README.md). It contains commands for managing the Android part of React Native app.
The npm package @react-native-community/cli-platform-android receives a total of 1,874,693 weekly downloads. As such, @react-native-community/cli-platform-android popularity was classified as popular.
We found that @react-native-community/cli-platform-android demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 34 open source maintainers collaborating on the project.
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.
Security News
Come meet the Socket team at BlackHat and DEF CON! We're sponsoring some fun networking events and we would love to see you there.
Security News
Learn how Socket's 'Non-Existent Author' alert helps safeguard your dependencies by identifying npm packages published by deleted accounts. This is one of the fastest ways to determine if a package may be abandoned.
Security News
In July, the Python Software Foundation mounted a quick response to address a leaked GitHub token, elected new board members, and added more members to the team supporting PSF and PyPI infrastructure.