Skip to content

Instantly share code, notes, and snippets.

@arafathusayn
Last active November 25, 2017 16:25
Show Gist options
  • Save arafathusayn/67cf9fcfb99dffd64d674da5487feee2 to your computer and use it in GitHub Desktop.
Save arafathusayn/67cf9fcfb99dffd64d674da5487feee2 to your computer and use it in GitHub Desktop.
[React Native Android] yarn run usb or, npm run usb (Linux or MacOS)

Add the code below to your npm scripts in package.json

"usb": "react-native run-android --deviceId $(adb devices | grep -oP '[0-9a-zA-Z]{7,30}\t')",

Example:

"scripts": {
  "start": "node node_modules/react-native/local-cli/cli.js start",
  "usb": "react-native run-android --deviceId $(adb devices | grep -oP '[0-9a-zA-Z]{7,30}\t')",
  "test": "jest"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment