I've built an app using ionic2 + cordova, now I am trying to run this in a real device. I have already set up all the things I had to, such as: %JAVA_HOME%, %ANDROID_HOME%, %ANT_HOME% and all the paths as well. However, as I try to run the command: ionic cordova run android, I recevive this error: "CORDOVA IS NOT A VALID TASK".
When I run: "ionic run android" I get this another error: "No emulator images (avds) found, if you would like to create an
avd follow the instructions provided here:
http://developer.android.com/tools/devices/index.html
Or run 'android create avd --name --target '
in on the command line."
Please, I am new in the mobile world, so I thought about starting a small POC, but I am not even being able to run this in my cellphone. Could someone help me out in this issue? I would appreciate it
ADB only recognizes Android devices, and in order for it to recognize your device you need to enable Debugging Mode on the Developer Settings of the device. Check out this tutorial.
Related
While running my cordova application through command promt I'm getting the following error:
No emulator images (avds) found.
1. Download desired System Image by running: "D:\Software\sdk\tools\android.bat"sdk
2. Create an AVD by running: "D:\Software\sdk\tools\android.bat" avd HINT: For a faster emulator, use an Intel System Image and install the
HAXM device driver
How can I fix this issue?
I'm new to this hybrid application development ,please help me out this issues.
Try below from your command line:
# create avd
android avd
# run emulator
ionic emulate android
I haven't work with cordova applications before, but I think the answer is clear, it's asking you to make an emulator so that your application can run on.
first, you need to run the .bat file specified on your local machine
D:\Software\sdk\tools\android.bat
choose the sdk. And then re-run the .bat file choosing avd.
and by doing so an emulator should be installed on your machine for the cordova application to run on.
I am developing Android applications using appcelerator. I am trying to build it through command using
titanium build -p android -b
argument.But it show 'ti'not recognized as internal or external command error.
The app run fine on emulator.I need to build it through command or on device.But my device also not accessing on Appcelerator.
Please help me to troubleshoot ti issue on command prompt.
are you using it in Windows OS? You probably did not configure the development environment properly.
You should follow this guide: http://docs.appcelerator.com/platform/latest/#!/guide/Installation_and_Configuration
and in particular the Software Locations and Environment Variables:
http://docs.appcelerator.com/platform/latest/#!/guide/Software_Locations_and_Environment_Variables
I am building an app with NativeScript, where I run:
$ tns run android --emulator
to build the app and launch it in an emulator. When I do this, the default android emulator boots on my machine, which is unusably slow...
In all the demos, they are using the Genymotion Emulator. I have installed this, but the NativeScript command still launches the default emulator. How do I get this to launch on the genymotion emulator?
NB: I am using Windows 10
Update:
Even if I run the command with the Genymotion emulator running (and nothing else), I get the following log output and a new terminal window is opened running android-sdk/tools/emulator-arm.exe
BUILD SUCCESSFUL
Total time: 11.959 secs
Project successfully built.
Using C:\Users\George\Source\Repos\NativeScript-App\Bluetooth\platforms\android\build\outputs\apk\bluetoothdemo-debug.apk
Starting Android emulator with image Xamarin_Android_API_23
That looks as though it is referencing the emulator I had been using when I was developing with Xamarin. Any ideas where I can change that, or why that is being called?
start Genymotion, then start one of the devices that you have setup in Genymotion
then check that the device is seen:
$ tns device
then run nativescript like so
$tns run android --geny 192.111.222.33:555
(or whatever is the name that you get from the tns device command)
To my experience --emulator always tries to start the stock emulators. Try to start genymotion and then just tns run android (w/o the --emulator option).
I think it does that when there is no emulator running.
Try starting Genymotion first, launch the image you want, then run the "tns run adroid" command.
I had a similar issue.
To use GenyMotion by default, first delete all the Android emulators using
android avd
I then followed the solution on this thread:
React-Native, Android, Genymotion: ADB server didn't ACK
Edit the settings in GenyMotion to use the android SDK you downloaded. (path for Windows is Users/YOUR-SYSTEM/AppData/Local/Android/android-sdk)
You still have to run the device on GenyMotion before running the emulator
tns run android
I have 2 devices detected in adb. One from my genymotion, and the other from my real device :
$ adb devices
List of devices attached
192.168.57.101:5555 device
e78ab88d device
I want to run my ionic app on e78ab88d device. How can i achieve this?
If i run ionic run android, its automatically run on my genymotion device. It says, no target specified.
img no target specified
What command to run on specific device?
run with target device id, something like :
ionic run android --target=e78ab88d
EDIT
With new Ionic 3 CLI use :
ionic cordova run android --target=e78ab88d
For list of all available devices, use :
ionic cordova run android --list
try this command may help you
ionic run android --e78ab88d
Using --target=e78ab88d failed for me. But it seemed to work when I used --device=e78ab88d.
Basically I have 2 Android phones connected and I wanted to target a specific device. without the --target or --device, it deployed randomly to the devices.
ionic cordova run android --device=e78ab88d worked for me. Just in case someone is experiencing the same problem as me.
to also run the app live do.
$ionic cordova run android -l
make sure that the phone is connected with laptop through cable.
There is a way to debug?
I use
ionic run android
command to run the app on android but then - how can I see console.log() messages?
Thanks
If you run your app in the livereload mode you will see the console.log() messages. You can start it like this:
ionic run android -l
You can also use chrome developer tools like it would be a normal webpage. Here is good description how you achieve that: Remote Debugging on Android with Chrome
Connect with an android device which has Android OS version >= 5
Enable developer option from the settings. This procedure varies from device to device. In addition you must enable USB debugging mode from developer option or from other section of your device.
If you get any error like “Your device is not connected” from Android SDK or Android studio then find out the problem from your device manager of pc. Most of the time appropriate driver or driver is not installed in the machine. Download it and follow my instruction in a video (Yafi Tech).
Run the command ionic cordova run android. APK is built and installed in the device. done
run “chrome://inspect” in the chrome status bar. Remote debugging of connected device has been started.
Now run the installed application and operate from the device or chrome.
Click on inspect of WebView. For debugging Go to the console of browser if you want to trace out any error.
you can also watch video here
Now that there is a livereload option (-l), to see the console.log messages you have to use -c or --consolelogs
But to have logs, the livereload option is required so :
ionic run android -lc
See the documentation for more options :
http://ionicframework.com/docs/v1/cli/run.html
The Ionic CLI has been updated for ionic 2+ to deploy app in live reload mode use the following command.
Synopsis
$ ionic cordova run <platform> <options>
Example
$ ionic cordova run android -l -c
Make sure that you have installed the latest version of Ionic/Cordova CLI
with Ionic 5 and cordova 9 use:
ionic cordova run android -l --consolelogs
where -l is for livereload
If you want a real debug, with watches, step into, etc, try the Cordova Tools extension for Visual Studio Code
The page constains the instructions for debuging on device.
Connect your android device to computer/laptop and simply run below command
ionic cordova run android --device -l --debug
From ionic doc
ionic run ios [options]
http://ionicframework.com/docs/cli/run.html