Via remote viewer VNC I can boot android emulator on remote machine
emulator -avd emu1
but via SSH on remote machine I get error
emulator: INFO: QtLogger.cpp:68: Warning: could not connect to display ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Info: Could not load the Qt platform plugin "xcb" in "/opt/androidtest/android-sdk/emulator/lib64/qt/plugins" even though it was found. ((null):0, (null))
Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb.
((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb.
((null):0, (null))
but If I boot emulator headlessly via SSH, the emulator boots
emulator -avd emu1 -no-window
To be exact, it does not matter from where you started the session but the value the DISPLAY environment variable contains, which indicates the XWindows display the emulator will be using to show the window and to receive mouse and keyboard events.
Then, you can start your session from SSH or VNC and set the DISPLAY environment variable to point to an X server you have access to.
The client program (in this case the emulator) knows which display to connect to by inspecting the DISPLAY environment variable.
Additionally, as it was mentioned in some comments, ssh -X or ssh -Y can be used to enable X11 forwarding. In this case, you can verify how the DISPLAY environment variable is automatically set to forward the display.
When you're connecting via SSH you are in a command-line session, detached from the UI. As aa result there is no link to the display, which is the error shown here:
emulator: INFO: QtLogger.cpp:68: Warning: could not connect to display ((null):0, (null))
When you're in VNC, the emulator can connect to the local display easily.
You can try X-window display remoting -
export DISPLAY=0:0
and assuming you have the display remoting allowed (xhost +) on the Window session) then the emulator window will pop up there. iptables/netfilter might block this, btw, so try with/without, and then add a specific rule (TCP 6000 if memory serves)
Note that, while this works, 'xhost +' is considered bad practice (as it allows GUI session hijacking). Also, if you're SSHing then you won't really be able to see the GUI (unless you're on another Linux, in which case DISPLAY=IP_youre_SSH_ing_from:0 and xhost + on the host you're ssh'ing from will actually get you a remote display).
Related
I am trying to install flutter without android-studio, currently the flutter doctor gives all ticks except for android studio and connected devices as per this guide. I created an emulator through avdmanager, and if I run it with flutter emulators --launch pixel it gets stuck on the loading screen and then becomes unresponsive. To get some more information I can run it with ${ANDROID_HOME}/emulator/emulator -avd pixel, this does the same thing but returns the following debug information:
emulator: WARNING: IniFile.cpp:235: Failed to open .ini file /home/cameron/.android/avd/pixel.avd/hardware-qemu.ini for writing.
qemu-system-x86_64: -drive if=none,index=1,id=cache,if=none,file=/home/cameron/.android/avd/pixel.avd/cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576: Could not open '/home/cameron/.android/avd/pixel.avd/cache.img.qcow2': Permission denied
Killed
Now since it seems to be a permissions issue, I can run the same command with sudo and it is able to start up the emulator but when I use the virtual power button to start the phone os it crashes with:
host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
E0619 23:22:33.309764951 29720 socket_utils_common_posix.cc:201] check for SO_REUSEPORT: {"created":"#1592572953.309674506","description":"SO_REUSEPORT unavailable on compiling system","file":"/mnt/tmpfs/src/android/emu-master-dev/external/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc","file_line":169}
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
Your emulator is out of date, please update by launching Android Studio:
- Start Android Studio
- Select menu "Tools > Android > SDK Manager"
- Click "SDK Tools" tab
- Check "Android Emulator" checkbox
- Click "OK"
[29707:29707:0619/232311.505803:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
I've tried to common response I found on the internet which is to use adduser on kvm but this didn't change anything. Some windows users have suggested marking certain files as writable but since I don't know which I'm very apprehensive. PS I'm on Ubuntu 18.04. Any help would be very appreciated!
Try
flutter clean
and then restart your flutter
When I start the emulator in Android Studio :
(Used Ubuntu 18.04.3 LTS)
Emulator: Warning: QStandardPaths: wrong ownership on runtime
directory /run/user/1000/snap.android-studio, 0 instead of 1000
((null):0, (null))
Emulator: Warning: QXcbIntegration: Cannot create platform OpenGL
context, neither GLX nor EGL are enabled ((null):0, (null))
There are two problems:
a) likely that snap install is crap, better install the standalone version of Android Studio
or run sudo chown -R 1000:1000 /run/user/1000/snap.android-studio to fix the permissions.
b) you need to install GL drivers, assuming you have a suitable graphics card available.
One can check these GL drivers with glxinfo -B.
I have installed new application from git but i'm having this red screen error can some one help me out.
ReferenceError: Can't find variable: process (http://10.0.3.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:2506)
E/unknown:React( 2312):
E/unknown:React( 2312): Try the following to fix the issue: E/unknown:React( 2312): • Ensure that the packager server is running E/unknown:React( 2312): • Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices
E/unknown:React( 2312): • Ensure Airplane Mode is disabled E/unknown:React( 2312): • If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device
E/unknown:React( 2312): • If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server - e.g. 10.0.1.1:8081
this output is adb logcat.
I have created the github issue any one can refer isssue
Did you run adb reverse tcp:8081 tcp:8081 as suggested in the error message? You always need to execute this after connecting a physical device, and you might need to do the same for Genymotion (never used it with React).
Also make sure that you have no other process running on port 8081: sudo lsof -n -i4TCP:8081 | grep LISTEN.
If you do, you can either kill that process by executing kill -9 <PID>, or start packager on another port: react-native start --port 8082.
If this doesn't help try to open the app on a basic Android emulator instead of Genymotion to see if you get the same error or not.
My problem is mismatch of the native-base module in react-native when i upgraded. checkout this issue and also do npm clean cache.
I also deleted node_module and reinstalled.
I went with native-base": "0.5.15" react-native : "0.33.1" and react is "15.3.1" and everything started working fine.
check this also facebook troubleshoot
My android virtual device starts up fine. But when it goes to load my ionic app it says: "app-name has stopped", "Open app again" after opening the app several times it says: "app-name keeps stopping close app". My app is the base tabs ionic app.
Ionic even says launch success...
I've tried different AVDs but none have worked. Here are the stats on my current one.
I've tried running it in with ionic run android -c -1 but all it says is
emulator: Requested console port 5584: Inferring adb port 5585.
emulator: Listening for console connections on port: 5584
emulator: Serial number of this emulator (for ADB): emulator-5584
EDIT: it works on Ionic serve just doesn't load on the android virtual device.
check if you have a service using that port or a program like skype that uses that port, then close or change the port it uses.
i had to close xampp in order to emulate android.
Checking use host GPU in the android SDK manager solved the problem for me.
I built the Android AOSP tree for the mako device successfully on my Ubuntu 14.04 LTS desktop with the '. build/envset.sh', 'lunch mako-userdebug', and 'make -j4' series of commands. I tried to run it in the emulator by following the Google-provided instructions (i.e. typing the 'emulator' command in a terminal right after the build is complete) but it does not work. The emulator starts up but is stuck on a black screen. I noticed the following warning/errors while the emulator starts up:
emulator: control console listening on port 5554, ADB on port 5555
emulator: can't connect to ADB server: Transport endpoint is not connected (errno = 107)
Any help in resolving this error is greatly appreciated.
Phil,
To make an image for the emulator, you will need to make one of the generic images. e.g. lunch aosp_arm-eng (you can also us userdebug, etc). It may not show up in the lunch menu, but it should be available nonetheless. The emulator was made strictly to test the changes made in the framework and to the default system properties (those that are hardware independent). Building the arm version should fix your errors!
Best!