Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run .apk file generated using Cordova on device instead of emulator?

I am using Sencha Touch 2.3.1 for developing cross platform application and to deploy it to native platforms I am using Cordova 3.3.0

I followed this tutorial. Following the tutorial I was able to run the .apk file in the emulator. Now I want to run the application on my device. Even though I connect my device to the laptop using a usb, I am not able to run the application on my device. Any help will be appreciated.

like image 662
user3213851 Avatar asked Jan 28 '14 09:01

user3213851


People also ask

Can I run an APK file directly on a PC without an emulator?

To open APK files on a PC without an emulator, you need to add the ARC Welder extension to your chrome browser. You can get this extension from here. After adding the extension, add APK files and click on 'Launch app'.

How do I run an APK file on an emulator?

Step to install APK in Emulator : Step 1 -> Run the emulator step 2-> Paste the apk in SDK manager tools and platform-tools folders. Step 3->Run this command adb install AppNaem. APK . Wait for 2 min it's show Success Message.

How do I run a Cordova emulator?

Configure an Emulator You can use either the cordova CLI utility or Cordova's Android-centered shell tools to run an app in an emulator. Either way, the SDK must first be configured to display at least one device. To do so, use the Android SDK Manager, a Java application that runs separately from Eclipse.


1 Answers

To have the project run on your device instead of in the emulator, you basically only have to plug in your device before you run cordova run android.

Cordova will run the emulator only if it can't find a device connected.

Before you run cordova run android, I advise you to run the command adb devices to check if your device is found by the android sdk tools.

If it's not, you need to enable USB debugging on the device and install an adb driver for your device.

Edit:

As this answer seems to get up votes, I think it would be a good idea to improve it a little...

There's actually a --device option you can add when you run cordova run android to force to start on the device (without that an emulator is started if no device is found, that can sometime be annoying).

like image 52
QuickFix Avatar answered Oct 05 '22 07:10

QuickFix