How To Run Ionic 4 App In Your Android Device Step By Step guide [May 2020]

[Total: 1   Average: 5/5]

Some Files You Need To Download

  1.  Download Java JDK 8
  2. Download and install Android Studio and Updated Android SDK tools, platform, and component dependencies. Available through Android Studio’s SDK Manager. if you would not update the android component then you will get many errors so keep in mind to update your android studio with the latest component dependencies.

Now set an environment variable

Here I am showing how to open the Environment Variables tab in the windows operating system.

Windows 10

  1. In Search,  type “env” and hit enter
  2. Click Environment Variables.
  3. Click Environment Variables. In the section User Variables,

Windows 7

  1. From the desktop, right-click the Computer icon.
  2. Choose Properties from the context menu.
  3. Click the Advanced system settings link.
  4. Click Environment Variables. In the section User Variables,

 

Now create 3 new variables

  • ANDROID_HOME
  • ANDROID_SDK_ROOT
  • JAVA_HOME 

Here I am showing you my path of SDK and JDK

  •  create a variable ANDROID_HOME and give the path of SDK example my path is
    C:\Android\sdk
  • #2 create a variable ANDROID_SDK_ROOT and give the path of SDK again example my path is
    C:\Android\sdk
  • #3 create a variable JAVA_HOME and give the path of JDK example my path is
    C:\Program Files\Java\jdk1.8.0_251

 

Enable USB debugging on your Android phone

  1. Open the Settings app.
  2. Select System.
  3. Scroll to the bottom and select About phone.
  4. Scroll to the bottom and tap the Build number 7 times.
  5. Return to the previous screen to find Developer options near the bottom.
  6. Scroll down and enable USB debugging.
  7.  also, enable install via USB  mode.

 

Now build your android app by this command

ionic build android

Now add your device by this command

adb devices

Now use this command to run your app in connected android device

ionic cordova run android

admin
Leave a Reply

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages