connect your device by usb. Then on your CLI try typing adb devices if a device is listed, run cordova run android.
If nothing appears on adb devices, go to settings on your phone, developer settings, and activate developer mode and usb debugging. You may need to re-plug your device after activating those settings.
This way you can test your app directly on your device.
For iphone just plug and cordova run ios
hiā¦ Bonda it was not work for me, I attached my device and debug/usb conected fine, when I typing adb devices into command line showed : list of devices attached, thats all. When I run cordova run android have error no started emulator found, what happen ?
Are you using window machine for development,if so What android device are you using? is your device is showing in file explorer? if not install the device driver ,for samsung devices samsung kies,or other manufacturer install respective device driver.if you done those you can try the adb commands
D:\AndroidWorkSpace\My>adb devices
List of devices attached
0123456789ABCDEF device
Hi, Iāve just documented how to view the console log on android:
Running logcat (see webview console log messages) on android
run ADB and get connected devices (first change dir to the android platform tools dir)
$ cd /Users/kevin/ADT/sdk/platform-tools
$ adb devices
List of devices attached
40CBA8038654 device
get PID (process ID) of app - first get all processes
$ adb -s 40CBA8038654 shell ps
then grep that (look for a string that identifies your app)
$ adb -s 40CBA8038654 shell ps | grep solomon (solomon being part of package name)
u0_a129 17099 151 363464 69256 ffffffff 00000000 S ie.solomon.myapp
$ adb -s 40CBA8038654 shell ps | grep 17099 (check for sub processes - so far iāve found that the app runs as a single process)
u0_a129 17099 151 363464 69256 ffffffff 00000000 S ie.solomon.myapp
finally run logcat and filter by PID so you just see output from your app:
adb -s 40CBA8038654 shell logcat āv time | grep 17099
For IOS, Iāve found that once you have installed it via the USB, by doing cordova run ios, it will automatically provide a log
All this is on a Mac, but steps exactly same on Ubuntu (Linux). Of course IOS only works with a Mac
Hi Thamil thanks for your direction yes I am using windows, now my device showed in explorer, and do adb devices it is LJNJZPNJWWQ84AM device show up! but when I did cordova run android, this is another ERROR: failed to launch application on device: ERROR: failed to install apk to device: pkg: /data/local/tmp/cordovaApp-debug.apk do you have idea?
@vanbumi Great,I dont have the exact idea but. I Can suggest some tricks to find out the exact problem.
1.Manually copy your apk file to device /sd card or phone storage and install manually. if it is success it may be the problem in USB cable connection refer here
I am trying to run this on a USB connected ios device (iPhone 5) and whenever I run ios it opens the simulator on my computer, and nothing happens on my iPhone. Is there a step I might have missed.
Any help would be much appreciated - I am trying to test bluetooth connectivity and from my simulator I am just seeing that bluetooth is not enabled. I think this is because I am not testing on a real device.
Then go into your project folder and u see a āplatformsā folder. In this folder u can see the platforms. Look in the iOS folder and open the xCode Project and then u can run your app on your iOS-Device.
INFO: You need a Provisioning-Profile, without this u cant build apps for your device!!!
For Android:
First look if you enabled Android-Development tool on your device. Then look in the Development-Tool, if USB-Debugging enabled!!!
After thees steps look into Security if is enabled to install apps from unknowns source.
You can also deploy to an android device connected to your local WiFi network. On most custom ROMs wifi adb is already built in and can be added to Quick Settings menu. It can also be enabled via Settings > Developer options ADB over network. If you donāt have the corresponding option then you can use a third party app which will let you turn it on and off. See e.g. https://play.google.com/store/search?q=wifi%20adb
Once you enabled ADB over wifi on the phone note down its IP address (e.g. 192.168.1.123), and then from terminal run:
adb connect 192.168.1.123
Now you can deploy directly to your phone without a cable:
ERROR running one or more of the platforms: No emulator images (avds) found. 1. Download desired System Image by running: āD:\Sdk\android-sdk\tools\android.batā sdk 2. Create an AVD by running: āD:\Sdk\android-sdk\tools\android.batā avd HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver
You may not have the required environment or OS to run this project
I am using windows 8 and Huawei with Android 4.2.2
Built the following apk(s):
E:/Aproject/Project file/thenationaltv app/mynationaltv/platforms/android/build/outputs/apk/android-debug.apk
native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-debug.apk
No hardare devices found, attempting emulatorā¦
Selected emulator emulator-5554
Error: ENOENT: no such file or directory, open āE:\Aproject\Project file\thenationaltv app\mynationaltv\platforms\android\app\build\outputs\apk\debug\app-debug.apkā
[ERROR] An error occurred while running subprocess native-run.
native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-d... exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.