Nativescript - native emulator error when run android --emulator - android

I receive the following error when I run android --emulator on my cmd;
Cannot run your app in the native emulator. Increase the timeout of the operation with the --timeout option or try to restart your adb server with 'adb kill-server' command. Alternatively, run the Android Virtual Device manager and increase the allocated RAM for the virtual device.
I've opened it with administrator rights and ran all the tutorials on the website.
I'm now stuck at this point and haven't been able to find the solution.
I've also tried tns run android --emulator --timeout -0 and waited for an hour without result.
What can i do to get the emulator running?

I had the same problem, I solved by opening avd manager and try starting the virtual device(emulator) you created. If the emulator doesnt launches, you will get an error in the console.
For me I had to install the intel HAXM, for launching the emulator

You just need to open your Android Virtual Device Manager and download
the latest emulator. Then run your application again.It will work.

tns run android
Runs the Emulator and then run the app on it.
Sometimes both process can't happen at once, admin access in Linux can be such case.
try starting the Emulator first then the app.
emulator -avd avd_name [ {-option [value]} … ]
for example:
sudo $ANDROID_HOME/emulator/emulator -avd test -netdelay none -netspeed full
'sudo' is important for Linux users.
then use this to start the app.
tns run android

Related

android studio only starts the virtual machine

When I recently studied React Native, I needed to use an emulator to test (when I don’t need a mobile phone to run).But every time you have to start Android Studio and then start the emulator, it is very troublesome to operate twice,
You can start your emulator by using command line, by open your CMD in your sdk folder / emulator. Then try this command
emulator -list-avds
To list your virtual devices and then
emulator -avd <device_name>
You can find the detail here
https://developer.android.com/studio/run/emulator-commandline#starting
Hope that help. ^^
You can start emulators from the terminal/ CMD without opening Android Studio.
To get the list of AVDs (run from sdk/emultor folder)
emulator -list-avds
To run any avd
emulator -avd avd_name [ {-option [value]} … ]
or,
/Users/janedoe/Library/Android/sdk/emulator/emulator -avd Nexus_5X_API_23 -netdelay none -netspeed full
For more details refer - Official guide

How can I have a gitlab runner start an Android emulator with a window on Ubuntu 16.04?

I'm using Gitlab on my android project and have a set of Espresso tests which run on a mac server. Gitlab-runner is setup on this mac to run in Shell mode and it execute a script which at the beginning starts an emulator:
emulator -avd my_avd
The machine has a screen and you can watch the emulator starting and the tests running.
I now have to switch to a Ubuntu server (it's running 16.04 lts), and I can't start the emulator with a window anymore, at least not from the gitlab-runner. When executing:
emulator -avd my_avd
It prints the error:
QXcbConnection: Could not connect to display
It works from a terminal though, just not from the gitlab runner service. I've had to add the flag no-window to allow the emulator to be started from the gitlab runner but then some tests fail, so I really need the emulator window.
How can I do this?
Exxecuting
DISPLAY=:0
before trying to run the emulator fixed it :)

Meteor App is not running on android emulator

I have installed jdk and created avd. After running command meteor run android --verbose, it is saying no emulator specified defaulting to nexus_5.
After running this command : emulator -avd emulator-5584
I am getting -
HOME is defined but could not find emulator-5584.ini file in
$HOME/.android/avd (Note: avd is searched in the order of
$ANDROID_AVD_HOME,$ANDROID_SDK_HOME/.android/avd and
$HOME/.android/avd)
Thanks in advance

How to run Android Emulator from Shell on Ubuntu Server

I installed Android SDK and JDK on Ubuntu Server 14.04 x64. But when I run the AVD, I got
error: 'SDL init failure, reason is: No available video device'
I follow this https://stackoverflow.com/a/6965679
sudo apt-get install ia32-libs
but didn't work.
Should I install any desktop on Ubuntu Server?
Try to run emulator without GUI following these steps:
From: http://paulemtz.blogspot.com/2013/05/android-testing-in-headless-emulator.html
Then, to run the headless emulator:
emulator -avd test -no-skin -no-audio -no-window
The '-no-skin' option removes the emulator buttons such as the home and other hardware keyboard buttons.
The '-no-audio' option disables the audio support.
Finally, the '-no-window' option disables the emulator's graphical window display.
Note that -avd test would need to be modified to refer to your specific emulator image (AVD).
You cannot run an emulator on the Server version of Ubuntu. The Emulator requires a GUI. Which the Server OS does not possess.
Rather use an Ubuntu Desktop OS
Then network your Server and Desktop, get the APK and upload it.
If you still wish to use Ubuntu Server with a GUI, refer to this, and repost the question with Ubuntu Server tags.

Android emulator is crashing frequently

After getting the latest update for Honeycomb , it seems the Android emulator is crashing and not responding quite frequently.
Also observed starting emulator with AVD which has snapshot stored earlier is also causing emulator freezing .
Any workaround ?
To reboot your emulator when it freezes, try running a cold boot. You can do this by navigating to the emulator files on your OS. If you are using Windows OS, this terminal command would look something like this:
cd C:\Users\your-account\AppData\Local\Android\Sdk\emulator>
Once you have navigated to the emulator directory, you can force a cold boot by running the following command:
.\emulator.exe -avd Your_Device_Name -no-snapshot-load
This will reboot your emulator.

Categories

Resources