shamanec / GADS-devices-provider

Set up iOS/Android devices for remote control with GADS UI and Appium test execution
MIT License
32 stars 4 forks source link

Error while running ./GADS-devices-provider : Could not add /dev folder to watcher #23

Closed AbhishakeDev closed 1 year ago

AbhishakeDev commented 1 year ago

Steps Followed :

  1. Ran GADS repo first after updating config for rethinkDB(Also running)
  2. Updated config in ./GADS-devices-provider
  3. Setup android device setup by adding device config as array in list in config
  4. Build Android Docker image(succeeded)
  5. Now running go run main.go or ./GADS-devices-provider getting this error

Starting provider on port:10001 Initial device update Starting devices healthcheck Starting /dev watcher panic: Could not add /dev folder to watcher when preparing to watch it: "/dev/nsmb0": resource busy goroutine 27 [running]: github.com/shamanec/GADS-devices-provider/device.devicesWatcher() /Users/abhishek/Documents/GADS-devices-provider-main/device/devices.go:126 +0x165 created by github.com/shamanec/GADS-devices-provider/device.UpdateDevices /Users/abhishek/Documents/GADS-devices-provider-main/device/devices.go:20 +0xfb exit status 2

Screenshot 2023-04-22 at 8 24 26 PM

My guess : Setup udev rules step needs the device provider repo to be running at localhost:port , but then some /dev folder is not present or not created hence giving error so not able to execute : curl -X POST http://localhost:{ProviderPort}/device/create-udev-rules

HELP PLEASE!!! Let me know if any steps are in wrong order.

shamanec commented 1 year ago

Sorry for the late reply, mate! Your steps seem fine to me. Are you running this in a VM or actual Linux machine? The /dev folder is present on all Linux distributions and is not something that GADS creates. The endpoint /create-udev-rules creates the udev rules which add symlinks for the devices in the /dev folder when a device is connected. This is what the watcher is watching for - adding/removing from the /dev folder. I've never encountered this error but I'll look into what could be the issue. You can contact me on Discord: shamanec#4281 or LI so I can help faster when I am online :)

shamanec commented 1 year ago

Oh, now I saw your console output :D Yeah, it is not going to work on a Macbook unfortunately. At the moment you can run GADS UI on a Mac but the provider works only on Linux

shamanec commented 1 year ago

What are you planning on using the project for? I am working on some changes right now but when I finish them maybe I can spend some time and see if I can build a simpler provider version for MacOS

AbhishakeDev commented 1 year ago

Hey @shamanec , thanks a lot for replying mate! I am planning to use this project as an ios device farm for my startup, to manually test and automate flows for my application, i have something already for android but ios is a pain in the a**. Ill check if i can arrange a raspberry pi for the provider, will linux on that be enough for the smooth functioning?

shamanec commented 1 year ago

Honestly I have no experience with Raspberry but as long as you can attach your devices over USB to it, I see no problem with it functioning :) I don't know if anyone is actively using this project at all and it has been pretty much tested only by me, so there might be different issues or missing information in the READMEs. Don't hesitate to contact me with any issues or feature requests and I will help out if I can :D

ssanmaru commented 1 year ago

What are you planning on using the project for? I am working on some changes right now but when I finish them maybe I can spend some time and see if I can build a simpler provider version for MacOS

I would like to have this setup running on MacOS. I was wondering if you have any plans of releasing GADS Device provider for MacOS soon. I am looking for a solution where i can build a small size iOS device farm and control them remotely. Thank you in advance!

shamanec commented 1 year ago

@ssanmaru hey, it is on my mind but I didn't have much time lately and been doing other changes. Do you need both iOS and Android? I can probably make it work in a week or two. I won't be using Docker containers on MacOS for the devices though due to some usb mounting limitations

ssanmaru commented 1 year ago

Hey @shamanec , Thank you for your prompt response. I am looking for iOS devices only. I would like to have these iOS devices controlled remotely (like click, tap, sendkeys,etc..)

shamanec commented 1 year ago

Sure, I'll try assembling something so you can get it going and maybe you'll test it for me as we go :D One more question @ssanmaru - do you plan to remotely control them on your own network? Currently the project is under the assumption of being used locally - you might be able to access devices through another network if you use ngrok but it's not something I aim for at the moment :D

shamanec commented 1 year ago

@AbhishakeDev @ssanmaru there is already a working solution on the macos-support branch. I am still updating the readme and I'll need to cleanup and improve the code but I should be able to merge it into main next week I hope :)

shamanec commented 1 year ago

done with #27 I would appreciate it if you check it out and let me know if any issues occur

shamanec commented 1 year ago

closing, if any problems occur please do open new issues