Skip to content

Instantly share code, notes, and snippets.

@aamnah
Last active February 3, 2021 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aamnah/80eb25012cae9e5b92055c1b1330e18e to your computer and use it in GitHub Desktop.
Save aamnah/80eb25012cae9e5b92055c1b1330e18e to your computer and use it in GitHub Desktop.
React Native - Running on physical device

NOTE: Seems like you can only test on one physical device at a time

Add manufacturer codes to udev rules

  • 0e8d - MediaTek (Infinix Hot 9)
  • 17ef - Lenovo
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="17ef", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules

Allow devices to connect to dev server

  • 054783604A010925 - Infinix
  • 0ANGUS008YN605950S2 - Lenovo
adb -s <device name> reverse tcp:8081 tcp:8081
adb -s 0ANGUS008YN605950S2 reverse tcp:8081 tcp:8081
adb -s 054783604A010925 reverse tcp:8081 tcp:8081

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment