Note: Your mobile must have developer options is ON
Please visit one https://www.youtube.com/watch?v=r33OwlTnTE4
Step 1. Make sure your system install or not android studio
Install Android studio: https://www.geeksforgeeks.org/how-to-install-android-studio-on-ubuntu/
Run this $ echo $ANDROID_HOME
getting this results: /home/zzzz/Android/Sdk
----------------------------------------------------------------
Step 2. Create new application
npx react-native@latest init ProjectName
-----------------------------------------------------------------
Step 3. Please connect your mobile with USB cable
Choose this line : File tranfer/Android Auto
-------------------------------------------------------------
Run on Phisical device
Visite this site: https://github.com/arvindkushwah9/React-Native-Example
Step 4. projects$ lsusb
Make sure your device is connected or not
Getting lists of all devices result:
Bus 002 Device 001: ID aaaaaa:aaaaaa Linux Foundation 3.0 root hub
Bus 001 Device 005: ID bbbbb:bbbbbb Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 004: ID ccccc:eeeee Intel Corp.
Bus 001 Device 003: ID vvvvv:ddddd Dell Computer Corp. Dell MS116 USB Optical Mouse
Bus 001 Device 006: ID XXXX:ffff Xiaomi Inc. Mi/Redmi series (MTP + ADB)
Bus 001 Device 001: ID bbbb:bbbbb Linux Foundation 2.0 root hub
My device ID is Xiaomi and device id XXXX
--------------------------------------------------------------
Step 5. run this line in the project directry
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="XXXX", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
-----------------------------------------------------------------------
Step 6. Run: npx react-native run-android
Install via USB is ON << under the Developer options
---------------------------------------------------------------------
Step 7. Run: npx react-native start
No comments:
Post a Comment