Cordova Run (in Real) Android Device Using Command Line?


Answer :

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.



If a real device is connected to your pc and it is recognized as well, you ca just use

cordova run android
and the app will start on your device. It worked for me.



Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools