MiniSim icon indicating copy to clipboard operation
MiniSim copied to clipboard

Incorrect Emulator list parsing

Open rigor789 opened this issue 1 year ago • 2 comments

There's a erroneous entry in the android emulator list

image

For reference:

$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager list avd
Available Android Virtual Devices:
    Name: Pixel_7_Pro_API_34
  Device: pixel_7_pro (Google)
    Path: /Users/rigor789/.android/avd/Pixel_7_Pro_API_34.avd
  Target: Google Play (Google Inc.)
          Based on: Android 14.0 ("UpsideDownCake") Tag/ABI: google_apis_playstore/arm64-v8a
    Skin: 1440x3120
  Sdcard: 512M
---------
    Name: ZTelevision_API_34
  Device: tv_1080p (Google)
    Path: /Users/rigor789/.android/avd/ZTelevision_720p_API_34.avd
  Target: Android TV
          Based on: Android 14.0 ("UpsideDownCake") Tag/ABI: android-tv/arm64-v8a
    Skin: 1920x1080
  Sdcard: 512 MB
$ANDROID_HOME/emulator/emulator -list-avds
INFO    | Storing crashdata in: /tmp/android-rigor789/emu-crash-34.1.20.db, detection is enabled for process: 58515
Pixel_7_Pro_API_34
ZTelevision_API_34
$ANDROID_HOME/emulator/emulator -version
INFO    | Storing crashdata in: /tmp/android-rigor789/emu-crash-34.1.20.db, detection is enabled for process: 58580
INFO    | Android emulator version 34.1.20.0 (build_id 11610631) (CL:N/A)
INFO    | Storing crashdata in: /tmp/android-rigor789/emu-crash-34.1.20.db, detection is enabled for process: 58580
INFO    | Duplicate loglines will be removed, if you wish to see each individual line launch with the -log-nofilter flag.
Android emulator version 34.1.20.0 (build_id 11610631) (CL:N/A)
Copyright (C) 2006-2017 The Android Open Source Project and many others.
This program is a derivative of the QEMU CPU emulator (www.qemu.org).

  This software is licensed under the terms of the GNU General Public
  License version 2, as published by the Free Software Foundation, and
  may be copied, distributed, and modified under those terms.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

This likely needs to be filtered here: https://github.com/okwasniewski/MiniSim/blob/0dffe44bce54dd321983bd79c56d78ccd5fa856c/MiniSim/Service/DeviceService.swift#L379-L391

Perhaps a simple && !$0.contains(" |") in the filter would be sufficient, as I don't think emulator names could/would contain | in their name.

rigor789 avatar Apr 16 '24 12:04 rigor789

image

Confirm Unable to Delete it
before after

mustafaabobakr avatar May 11 '24 11:05 mustafaabobakr

Hey, this is a bug in ADB that happens after upgrading Android Studio. Try to update to the latest version and remove this simulator using Android Studio. You can check if ADB works properly using:

emulator -list-avds

okwasniewski avatar May 11 '24 12:05 okwasniewski

It is a bug of emulator. This StackOverflow answer worked for me: https://stackoverflow.com/a/78111618.

It might be worth filtering emulator names started by INFO | Storing crashdata in.

arthur-fontaine avatar Jul 16 '24 20:07 arthur-fontaine

I've added filtering out emulator names in 0.8.4

okwasniewski avatar Jul 20 '24 20:07 okwasniewski