Device always invalid on Ubuntu
Splitting on Environment.NewLine, or including "\r" would fix the issue. Ubuntu (and Linux in general) uses "\r" for newlines. Otherwise t gets one long string and fails to match the RegEx.
I take it back, this might not quite be the issue. Let me investigate some more.
So I am not understanding how this fixes it... it currently splits on \r\n or \n, Environment.NewLine should only be \n on linux, \r\n on windows.
ok, now, i see your new message.
Yeah I'm apparently very wrong lol. It is having an error at the parsing stage (most likely when it splits) for some reason, but I'm not sure why yet (checking the regex shows that it does match the adb devices output).
can you put the error that you are seeing in this issue
If it was splitting correctly, then the RegEx should be successful (I tested it against the output of adb devices)
There's an outside possibility that something different is being returned from adb than I'm seeing, but I can't imagine why that would be.
can you post the value that is coming in in data. feel free to XXXX out any values if you want.
Lemme see. I'm running it through a test adapter so I'll have to create a new project to call it directly.
It doesn't look like I can debug that code from the package. I can pull down the code locally and try that. I don't know if it will build though since it isn't .NET Core.
Yeah I can't build it outside of a .NET Core project. So there's no way for me to tell really. Is there any way you could push up a NuGet with some logging?
Hello. Did you get a chance to look at this? I don't have any way of figuring out what the input was.
Hey. Just following up. Any chance to look into this?
no permissions
This is due to adb not being started with elevated permissions. I don't know if ManagedAdb automatiaclly runs the kill-server and start-server commands at some point. (I hope not?)
But if not, starting adb with sudo privileges at boot-time would resolve this issue. If so, the library should at least throw a warning that it tried to start adb in elevated mode but a password was requested.
adb kill-server
sudo `which adb` start-server
You can make an entry in the ect/sudoers.d folder to skip the password requirement for sudo adb. You should refactor your project into a more debuggable form for situations like this.
This is the easiest solution assuming you aren't in a non-sudo Linux system, like Fedora.
Other approach is to add yourself to plugdev group and put adb executable under non-root owner.
sudo usermod -aG plugdev kthprog
sudo chown kthprog `which adb`
sudo chgrp kthprog `which adb`
sudo chmod 775 `which adb`
Weird. It works fine when I run adb myself. I don't think adb is being run under my account. I'll sort through the code and figure out what it's running under.
if you run adb yourself with the devices you have at work attached, i expect some will return 'no permission'
looks like there are 5 references to either Stop() or Restart() in AndroidDebugBridge.cs
what's curious is StartServer() is a totally empty method. I had had this problem with the library in the past, on Tony's app, that it wouldn't start a server but depended on one running already. So i had to ALWAYS start it from command prompt. Pretty stupid really
Assuming it does issue the kill server command, the best option is probably a simple python script running in the background which constantly checks for devices with 'no permissions' and restarts the server with sudo priviledges if this ever happens. You can put the python script in your startup commands on Ubuntu.
Initially I thought it might be best to fix this issue in the library itself under a new fork, but you're right, it's probably best to just put a nice little script on the Linux box.
I'm getting this error again now on Windows. Even though the list comes up fine in cmd
that's because no one has pushed a commit to this repo in 3 years. Anyone who would use it for Android 9 is a fool
make your own wrapper and you will be thankful
Lmao sup Shane. Didn't know it was that out of date. Seems too buggy to keep using
it's also possible no commits have been pushed because it is already perfect. you should ask the maker directly what's up @camalot