AppiumTestDistribution / appium-device-farm

This is an Appium 2.0 plugin designed to manage and create driver sessions on available devices.
https://devicefarm.org
Other
339 stars 102 forks source link

Tag --plugin-device-farm-booted-simulators dont work properly #1399

Open CharlanSofist opened 1 month ago

CharlanSofist commented 1 month ago

Describe the bug

When i start appium with plugin device farm with this comand appium server -ka 800 --use-plugins=device-farm --plugin-device-farm-platform=both --plugin-device-farm-booted-simulators --plugin-device-farm-live-streaming and i dont start any simulator, the device farm list a non booted IOS devices.

image

Link to Appium logs https://gist.github.com/CharlanSofist/e2b91f7feeba55de1a5603802009f49b

Environment

  1. Appium version (or git revision) that exhibits the issue: 2.11.3, device-farm@9.2.11 [installed (npm)]
  2. Last Appium version that did not exhibit the issue (if applicable):
  3. Node.js version (unless using Appium.app|exe): 22.8.0
  4. Npm or Yarn package manager: 10.8.2
  5. Mobile platform/version under test: IOS
  6. Real device or emulator/simulator: simulator
  7. Appium CLI or Appium.app|exe: N?A
erdncyz commented 1 month ago

Hi @CharlanSofist,

Can you try below command?

appium server -ka 800 --use-plugins=device-farm, --plugin-device-farm-platform=both

--plugin-device-farm-live-streaming: For this feature, you can add your capabilities df:liveVideo: true parameters ?

CharlanSofist commented 1 month ago

Hi @CharlanSofist,

Can you try below command?

appium server -ka 800 --use-plugins=device-farm, --plugin-device-farm-platform=both

--plugin-device-farm-live-streaming: For this feature, you can add your capabilities df:liveVideo: true parameters ?

Hi @erdncyz with your command its brings all devices including those not booted, i need it list just booted ios devices.

erdncyz commented 1 month ago

Hi,

By booted device do you mean real devices?

CharlanSofist commented 1 month ago

@erdncyz no, i mean devices emulator started

erdncyz commented 1 month ago

You can delete in Xcode

image
CharlanSofist commented 1 month ago

@erdncyz I can do this, but this doesn't solve my problem, for an example if I start the device farm with an Android emulator started it will always show the existing IOS devices even if it not start, it generates a problem when I request devices free on farm, and it returns as devices.

erdncyz commented 1 month ago

Hi @CharlanSofist

I understand, the situation with iOS devices is actually related to Xcode, so as long as Xcode is installed, iOS devices always appear as available. It doesn't matter whether the devices are started or not; they are listed simply because Xcode is installed. This is a feature of Xcode's device management.

For Android devices, the situation is different; you need to manually start physical or virtual devices (emulators) through Android Studio. Devices that are not started are not listed in the device farm.

To resolve or better manage this issue, you can try the following:

Deleting iOS devices not used from the simulator:

If you don't want iOS devices to appear in the list all the time, even if Xcode is installed, you can delete the ones not being used from the simulator.

saikrishna321 commented 1 month ago

@erdncyz Actually what @CharlanSofist is asking is only booted simulators should be picked by device-farm when the server is started with the flag.

erdncyz commented 1 month ago

@saikrishna321 yes thank you for your explanation but the simulator that Xcode has installed sees the devices as connected, so I think it sees them as active in the device farm.

saikrishna321 commented 1 month ago

@erdncyz Simulators have two stats, booted and shutdown.

saikrishna321 commented 1 month ago

@CharlanSofist Just looked at the code. If you have atleast one booted simulator then the plugin will only pick the booted simulators else it picks all the simulators.

image

CharlanSofist commented 1 month ago

@saikrishna321 Exactly, maybe my explanation wasn't very clear, but I can see you understood.

CharlanSofist commented 1 month ago

@CharlanSofist Just looked at the code. If you have atleast one booted simulator then the plugin will only pick the booted simulators else it picks all the simulators.

image

Yes it happens, but if I don't start any simulator its return all, that is the problem.