Monday, December 17, 2018

React Native App Development on Physical Android device on Windows.

React Native App Development on Physical Android device on Windows.


So let’s begin…

Step – 1: Enable Developer options on your physical android device. If you have already enabled Developer options then you can simply skip this step.

Go to Settings ---> About phone/device ---> Tap Build number option Seven times or more.
Go back to Settings and Connect your android device with your PC using USB cable.


Step – 2: Enable USB debugging option on your physical android device.

Note - connect the USB thereafter enables the USB debugging,
otherwise  need to reboot






Step – 3: Visit platform-tools folder under your Android SDK installation path folder and type cmd in address bar to open command prompt with required path.

Note: Android SDK installation path may vary.
In my case:




Step – 4:  Type following command in command prompt to check that your physical android device is properly connected to ADB.

adb devices

In my cases

If your device is properly connected to ADB then you will get following output:



Step – 5:  Apply following command in command prompt to use development server functionalities on your physical android device.

adb reverse tcp:8081 tcp:8081



Now your physical android device is ready to do react native app development, If the above command executes successfully.

Step – 6:  Now, Go back to your react native project directory and apply react-native run-android  command in command prompt. 
If no issue occurred then you will get the following output (in my case) in your physical android device.

Note: I have created a very simple app which simply renders a Text component at the center of the screen for demonstration propose.




You can now run your app without cable


Open your app & shake your phone > Dev Settings > Debug Server host & port for device > type your wifi's ip address + the metro bundler port 

(E.g 192.168.1.1:8081)


OR


If getting some error like  that as bellow




Solutions :---

Step -7

open your command prompt or terminal
type ipconfig
and copy of ip address

and continue to follow the below some step
ctrl +M








..................................................................................................................................................................................................................................................
Important command
kill the server

# > adb kill-server
#> adb start-server
#> adb devices

C:\Users\sapan\AppData\Local\Android\Sdk\platform-tools>adb kill-server
C:\Users\sapan\AppData\Local\Android\Sdk\platform-tools>adb devices
Enabling Keyboard Shortcuts:
Note: First run the project and thereafter run the below command of
#> adb shell input keyevent 82

C:\Users\sapan\AppData\Local\Android\Sdk\platform-tools>adb shell input keyevent 82




..................................................................................................................................................................................................
COMMON ERRORS ?




adb shell input keyevent 82

adb shell input keyevent KEYCODE_MENU
adb shell input text "RR"

dd
................................................................................................................................................................................................................................
Fix ADB Devices Not Shown|USB Debugging issue| Device is not listed in adb devices Camand| Miui8


C:\Users\sapan\AppData\Local\Android\Sdk\platform-tools

C:\Users\sapan\AppData\Local\Android\Sdk\platform-tools>adb devices
looks like below one?





........................................................................................................................................................................................................................


................................................................................................................................................................................................................................




................................................................................................................................................................................................................................

..........................................................................................................................................................................................................................







........................................................................................................................................................................................................................



........................................................................................................................................................................................................................

........................................................................................................................................................................................................................
........................................................................................................................................................................................................................
........................................................................................................................................................................................................................



8 comments:

  1. Great post. thank you for sharing such a great information about React Native App Development

    ReplyDelete
  2. I simply want to say I’m very new to blogs and actually loved you’re blog site. Almost certainly I’m going to bookmark your blog post . You absolutely come with great well written articles. Thanks a lot for sharing your blog.
    Mobile App Development Company in Dubai
    Android App Development Company in Dubai
    Mobile App Development Company
    Android App Development Company in UAE

    ReplyDelete
  3. I read a weblog, I hope that it doesn't sadden me as much as this one. I’m talking about, I know it was my selection to read, but I actually thought you'd have something interesting to say. Great work admin..
    Mobile App Development Company in Dubai
    Android App Development Company in Dubai
    Mobile App Development Company
    Android App Development Company in UAE

    ReplyDelete
  4. Your posts is really helpful for me.Thanks for your wonderful post.It is really very helpful for us and I have gathered some important information from this blog.
    Mobile App Development Company in Dubai
    Android App Development Company in Dubai
    Mobile App Development Company in UAE

    ReplyDelete