0

android emulator

I'm following the tutorial on how to setup the android emulator through https://docs.nativescript.org/angular/tooling/android-virtual-devices.

I ran these commands

Change into the tools bin dir
: cd /usr/local/android/sdk/tools/bin
: sudo chmod +x

Install system images (must be done as root)
: sudo ./sdkmanager "system-images;android-25;google_apis;x86"
: sudo ./sdkmanager --licenses
Say 'y' to all
: sudo touch ~/.android/repositories.cfg

List available Android Virtual Devices to install (done as user)
: ./avdmanager list
: ./avdmanager create avd -n test -k "system-images;android-25;google_apis;x86"

Now I get the following when I list through avdmanager
: ./avdmanager list avd
: Available Android Virtual Devices:
:     Name: test
:     Path: /root/.android/avd/test.avd
:   Target: Google APIs (Google Inc.)
:           Based on: Android 7.1.1 (Nougat) Tag/ABI: google_apis/x86

Now try and run the android emulator
: cd ~/code/MyApp
: tns run android

Once this is started the Android emulator does start up on my Debian 8 thin client but it shows up like the attached image.

Update: Running through Android Studio android emaultor running through studio

It's the same result. I've got this type of result also running the the command line. Funny enough you can actually click buttons when it looks like this and still use it, although it's pretty useless.

Update: Can run through X2go

I ran a test remotely today using the same server and I can run the emulator through the X2go remote login software, but not natively on the thin client. I'm starting to think this is a specific problem of running android emulators under LTSP (thin client).

map7
  • 5,096
  • 6
  • 65
  • 128
  • `Android emulator does start up` Does that mean emulator is not starting all ? As you mentioned it is happenning after `tns run android` , so I am confused. That screenshot is when emulator starts or when app starts? – Narendra Jul 12 '19 at 06:11
  • The emulator does start but is unusable as the graphics are corrupted and the focus of the mouse keeps moving. I'm thinking it's not interacting with the video driver correctly. – map7 Jul 16 '19 at 00:02
  • Yes, It looks like emulator problem only. Can you try creating another emultor from AVD and see if that runs? – Narendra Jul 16 '19 at 00:05
  • @Narendra Do you mean the Android Studio AVD section? – map7 Jul 17 '19 at 05:41
  • yes, I mean Android Studio AVD only – Narendra Jul 17 '19 at 05:42
  • @Narendra Same results if I start it through Android Studio AVD. – map7 Jul 18 '19 at 01:28
  • Did you try creating another device(emulator) ? or are you starting the same device? – Narendra Jul 18 '19 at 01:30
  • @Narendra That was an existing device. I just created a new device under Android Studio and it doesn't start at all. (Pixel 2 with Android 9.0). I even started a new Virtual Device with the same Android version as my 'test' device called Pixel with Android 7.1.1, this also didn't start at all. – map7 Jul 18 '19 at 01:36
  • Looks like you need to re-install android studio. it has nothing to do with Nativescript. This might be helpful https://stackoverflow.com/questions/28720233/android-emulator-is-very-distorted – Narendra Jul 18 '19 at 01:52
  • you can try playing with Display setting as well https://stackoverflow.com/a/53111168/3840213 – Narendra Jul 18 '19 at 01:54
  • This seems to be a problem of running the emulator on a thin client. I'm working remote today through X2go to the same linux server and can run the emulator. – map7 Jul 24 '19 at 01:06

1 Answers1

0

As I'm running the emulator on a thin client it doesn't look like I can use the 3d hardware acceleration so I've managed to turn it off with the following and the emulator now works pretty good.

$ANDROID_HOME/emulator/emulator -avd test -gpu guest

I'm also using the i3 tiled windows manager and had to force floating on this window;

# Set floating windows
for_window [title="Android Emulator - test:5554"] floating enable
map7
  • 5,096
  • 6
  • 65
  • 128