Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cordova run (in real) android device using command line?

According to the documentation

We can run our android project on an emulator by:

cordova run android or

cordova emulate android 

But how to run a project on a real android device?

thanks a lot

-EDIT-

adb devices list none..

like image 773
Toni Michel Caubet Avatar asked Mar 04 '15 10:03

Toni Michel Caubet


People also ask

How you will install cordova using command prompt?

You can run the following command in command prompt to install the Cordova application on Windows: C: \>npm install -g cordova.

Which command is used to cordova?

The cordova module will automatically be downloaded by the npm utility. On OS X and Linux, prefixing the npm command with sudo may be necessary to install this development utility in otherwise restricted directories such as /usr/local/share .


1 Answers

You can force the run on device like this

cordova run android --device 

If you get an error message like "No devices found" then make sure that you have developer mode and USB Debugging enabled on the device and also run adb kill-server and then adb devices should list your device and cordova run android --device should work

For iOS you can run from macOS

cordova run ios --device 

If it doesn't work, make sure you have ios-sim and ios-deploy installed and that you have your development certificate and a wildcard provisioning profile on your machine. You can open the .xcworkspace file on /platforms/ios/ and Xcode will help you to create the certificates and provisioning profiles when you try to run the app.

like image 61
jcesarmobile Avatar answered Oct 03 '22 22:10

jcesarmobile