microsoft/appcenter

“iOSDeviceManager” will damage your computer. You should move it to the Bin.

evgenyvalavin opened this issue · 43 comments

Xamarin.UITest 4.3.2
macOS Sonoma 14.1.2 (and 14.2)
VS Code 1.85.0

Cannot run UITests because this message appears when I start a UI test:
Screenshot 2023-12-11 at 19 42 18

Tried two ways to bypass malware protection - nothing worked.
Tried:

  1. Disabling Gatekeeper app verification (sudo spctl --master-disable). And then allow apps from Anywhere in Settings
  2. Disabling Gatekeeper for single app (/private/var/folders/_q/lkcdrh251t38kjy38s97x6sw0000gn/T/xdb/DeviceAgent.iOS.Dependencies...) via xattr -r -d com.apple.quarantine {path}

It's impossible to run UI Tests for me now. What to do?

@IlyaBausovAkvelon hi! Your help is needed

axsha commented

We have the same problem on all our Silicon Macs (m1, m2). The Intel based Macs seems to be still fine.

The Intel based Macs seems to be still fine.

I have an Intel MacBook.
I believe the problem appeared after macOS update to 14.1.2

axsha commented

On both Macs (Intel and Silicon) we run Ventura 13.6.*. The strange thing is, that without changing the software configuration on our systems the problem occurs since a couple of days...

Still works:

  • MacBook Pro Intel Core i9
  • macOS Ventura 13.6
  • Xamarin.UITest 4.1.3, Xamarin.UITest 4.1.4
  • Visual Studio 17.6.4

Does not work anymore:

  • MacBook Pro Apple M1 Pro, MacBook Pro Apple M2 Pro
  • macOS Ventura 13.6.1, macOS Ventura 13.6.3
  • Xamarin.UITest 4.1.3, Xamarin.UITest 4.1.4, Xamarin.UITest 4.3.2
  • Visual Studio 17.6.7

UI tests worked fine on 7 of December.
Yesterday UI tests were not possible to run.

axsha commented

In the meanwhile the problem is also on Intel Mac (2.7 GHz, i7) running macOS Ventura 13.5.1 :-(

Happening here as well, on two computers that did not perform any update. Seems like Apple uploaded some malware protection file that is mis-flagging this

I am also facing this issue since yesterday , it has become blocker now for my further work,

We are encountering the same issue, even with the latest version of Xamarin.UITests (4.3.2). Does anyone have a workaround or a solution for this problem? Additionally, a similar issue is being discussed in the iOSDeviceManager repository, which can be found here: calabash/iOSDeviceManager#269. Any insights or shared experiences regarding this would be appreciated

With the brand new Xamarin.UITest 4.3.3 Update the iOSDeviceManager was replaced by Facebook's idb.

https://www.nuget.org/packages/Xamarin.UITest/4.3.3/
Replaced iOSDeviceManager usage with Facebook's idb. To use idb you will need to install it with brew on target system. idb-companion is not needed

A new challenge is the installation of the idb and letting Visual Studio know where to find the idb installation (unfortunately Visual Studio ignores the global PATH declarations). Anyway now we are able to perform UI Tests on iOS 17 simulators again. But UI Tests on IOS < 17 seems to be very unstable (?).

I'm getting the same error using Xamarin.UITest 4.3.3.

iOSDeviceManager is still being used, and there is no mention of Facebook's idb. Also not sure how great of a design it is to require developers to install something via Homebrew just to make the NuGet work... what about our pipelines?

We are seeing the same issue!

With the brand new Xamarin.UITest 4.3.3 Update the iOSDeviceManager was replaced by Facebook's idb.

https://www.nuget.org/packages/Xamarin.UITest/4.3.3/ Replaced iOSDeviceManager usage with Facebook's idb. To use idb you will need to install it with brew on target system. idb-companion is not needed

A new challenge is the installation of the idb and letting Visual Studio know where to find the idb installation (unfortunately Visual Studio ignores the global PATH declarations). Anyway now we are able to perform UI Tests on iOS 17 simulators again. But UI Tests on IOS < 17 seems to be very unstable (?).

If you could outline the steps you took to install and get VS to find it, that would be helpful (and appreciated) until we can all get a proper fix from Xamarin.UITest folks

MacOS:

a) update your UITest Project with newest Xamarin.UITest 4.3.3.
b) install "idb client" (not idb companion) (https://fbidb.io/docs/installation/) -> "pip3.6 install fb-idb" did not work for me but "pip3 install fb-idb"
c) search for the installation path (which idb)
d) add this idb installation path to your PATH in your $HOME/.bash_profile
e) update you bash profile via terminal cmd: source $HOME/.bash_profile
f) check if your PATH now contains your idb installation path info via terminal cmd: echo $PATH
g) open Visual Studio via terminal cmd (not by tapping on your app icon): open -n "/Applications/Visual Studio.app"

For me this is only a workaround. We have to find a better way to put some environment/path information into VS.

We are blocked by this also!

image

This is also a blocker on our end. Started to encounter this issue since yesterday.

Is there anyone here find a workaround for this issue? Thanks in advance.

Just tried Xamarin.UITest 4.3.3. Installed Facebook IDB.
I get this error when trying to run a UI test

System.AggregateException : One or more errors occurred. (Failed to launch simulator
ExitCode: 1
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    async with self._start_companion_command(arguments=arguments) as process:
    await companion.boot(udid=self.get_udid(args))
    more...
[ERROR] - root - Exception thrown in main
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/idb_companion'
Traceback (most recent call last):
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Xamarin.UITest.iOS.iOSAppLauncher.LaunchAppLocal(IiOSAppConfiguration appConfiguration, HttpClient httpClient, Boolean clearAppData)

MacOS:

a) update your UITest Project with newest Xamarin.UITest 4.3.3. b) install "idb client" (not idb companion) (https://fbidb.io/docs/installation/) -> "pip3.6 install fb-idb" did not work for me but "pip3 install fb-idb" c) search for the installation path (which idb) d) add this idb installation path to your PATH in your $HOME/.bash_profile e) update you bash profile via terminal cmd: source $HOME/.bash_profile f) check if your PATH now contains your idb installation path info via terminal cmd: echo $PATH g) open Visual Studio via terminal cmd (not by tapping on your app icon): open -n "/Applications/Visual Studio.app"

For me this is only a workaround. We have to find a better way to put some environment/path information into VS.

I had done all the steps and running from Terminal was the final peice I needed to get it running. For me the tests run on the simulator in the background. They used to run where you could see them. I found that once the tests start you can open the sim and view the tests as they run. Start up for the tests is much slower than it used to be...

I had done all the steps and running from Terminal was the final peice I needed to get it running. For me the tests run on the simulator in the background. They used to run where you could see them. I found that once the tests start you can open the sim and view the tests as they run. Start up for the tests is much slower than it used to be...

Unfortunately we have the same effect (simulator in background and uitest seems to be more unstable like before)

Here are the steps I took to solve the problem.

  1. Update Xamarin.UITest to version 4.3.3
  2. Make sure you have Python installed in version 3.6 or higher
  3. Make sure you have pip installed
  4. Install idb according to what we have here https://fbidb.io/docs/installation/ but with slightly modified commands
brew tap facebook/fb
brew install idb-companion
pip3 install --user fb-idb
  1. Add an entry to PATH that includes the path to idb (for example /Users/temp/Library/Python/3.9/bin)
  2. Update changes by source ~/.bash_profile
  3. Restart the computer

I followed similar steps yesterday and got it working except
my simulator is not auto launched when executed tests. I had to open to see tests running

Thank you for all your support

Moshex commented

@blazej-kosmowski
How do you do "Add an entry to PATH that includes the path to idb (for example /Users/temp/Library/Python/3.9/bin)" and "Update changes by source ~/.bash_profile"

in my ~/.bash_profile I have the following:

export ANDROID_HOME=/Users/<username>/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:~/.nexustools
export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/3.12/bin/

export ANDROID_HOME=/Users/yourName/Library/Android/sdk
export ANDROID_HOME=/Users/yourName/Library/Android/sdk

Does that look correct or do I have this wrong? I have tried all different forms and I am still not able to run iOS at all using VS for Mac on iOS. Keep in mind that is I use this path in terminal "/Library/Frameworks/Python.framework/Versions/3.12/bin/idb" it executes the idb

@Moshex I'm not sure. I am using one defined PATH in my bash_profile file. It looks like this:

export ANDROID_HOME=/Users/temp/Library/Android/sdk
export PATH=/fist/absolute/path:/second/absolute/path:/Users/temp/Library/Python/3.11/bin

As you can see, there are absolute paths to directories that I want to add, followed by a : when I want to add another path to PATH.

What worked for me without changing any PATH variables.
Xamarin.UITest 4.3.3.
VS Code

  1. Install Python
  2. Install Brew
  3. Run commands to install idb:
brew tap facebook/fb
brew install idb-companion
pip3 install --user fb-idb
  1. If xcode-select -p prints /Library/Developer/CommandLineTools, then run sudo xcode-select -s /Applications/Xcode.app to make sure you're using the right path of tools

No reboot or restart required.
Run UI Tests as usual

The initial issue seems to be solved. Closing this
Thanks everyone!

I wouldn't consider this issue solved until anyone can install the latest Xamarin.UITest NuGet as-is (this is the AppCenter GitHub page after all) and it works without jumping through hoops. Plus NuGets should not require updates to bash profiles and installing who-knows-what with homebrew or pip3

Finally, we're going to need this NuGet to work on DevOps pipelines without any extra steps...

Moshex commented

@dsmitchell
I agree 100% with what you just stated

Moshex commented

@blazej-kosmowski and @evgenyvalavin
I have tried both of what you guys have stated and it still does not work ill post all the commends I did and the results below. I am not sure what I am missing and why I cant seem to get this to work:

mymackbook@Name-MacBook-Pro-4 ~ % brew tap facebook/fb
Running `brew update --auto-update`...
Installing from the API is now the default behaviour!
You can save space and time by running:
  brew untap homebrew/core
  brew untap homebrew/cask
mymackbook@Name-MacBook-Pro-4 ~ % brew install idb-companion
Warning: facebook/fb/idb-companion 1.1.8 is already installed and up-to-date.
To reinstall 1.1.8, run:
  brew reinstall idb-companion
mymackbook@Name-MacBook-Pro-4 ~ % brew reinstall idb-companion
==> Fetching facebook/fb/idb-companion
==> Downloading https://github.com/facebook/idb/releases/download/v1.1.8/idb-companion.universal.tar.gz
Already downloaded: /Users/Name/Library/Caches/Homebrew/downloads/7a067665ea5689d6f1fcffae958eff8291f4594c2e1b9dafd2fcc8d2cb6ff32e--idb-companion.universal.tar.gz
==> Reinstalling facebook/fb/idb-companion 
🍺  /usr/local/Cellar/idb-companion/1.1.8: 215 files, 77.3MB, built in 7 seconds
==> Running `brew cleanup idb-companion`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
mymackbook@Name-MacBook-Pro-4 ~ % pip3 install --user fb-idb
Requirement already satisfied: fb-idb in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (1.1.7)
Requirement already satisfied: aiofiles in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from fb-idb) (23.2.1)
Requirement already satisfied: grpclib>=0.4.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from fb-idb) (0.4.6)
Requirement already satisfied: protobuf in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from fb-idb) (4.25.1)
Requirement already satisfied: treelib in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from fb-idb) (1.7.0)
Requirement already satisfied: h2<5,>=3.1.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from grpclib>=0.4.0->fb-idb) (4.1.0)
Requirement already satisfied: multidict in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from grpclib>=0.4.0->fb-idb) (6.0.4)
Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from treelib->fb-idb) (1.16.0)
Requirement already satisfied: hyperframe<7,>=6.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from h2<5,>=3.1.0->grpclib>=0.4.0->fb-idb) (6.0.1)
Requirement already satisfied: hpack<5,>=4.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from h2<5,>=3.1.0->grpclib>=0.4.0->fb-idb) (4.0.0)
mymackbook@Name-MacBook-Pro-4 ~ % xcode-select -p                             
/Applications/Xcode.app/Contents/Developer
mymackbook@Name-MacBook-Pro-4 ~ % sudo xcode-select -s /Applications/Xcode.app
mymackbook@Name-MacBook-Pro-4 ~ % xcode-select -p                             
/Applications/Xcode.app/Contents/Developer
axsha commented

Ok, the malware thing (this issue was reporting) is "solved".
BUT as the new solution with 4.3.3 contains to many (untested?) changes and is completely unstable (for us), in professional projects it is not usable anymore.
Can you please provide us a new Xamarin.UITest distribution just containing a newly signed version of IOSDeviceManager?
As already stated in the issue (calabash/iOSDeviceManager#269) the Malware Protection is (again) complaining due to an expired signing certificate used for signing the contained IOSDeviceManager app.

As we are usually blocked on similar issues for unknown amount of time, I would highly appreciate if the Xamarin.UITest Package would be open source. Can you please check this with your team?

Here are the steps I took to solve the problem.

  1. Update Xamarin.UITest to version 4.3.3
  2. Make sure you have Python installed in version 3.6 or higher
  3. Make sure you have pip installed
  4. Install idb according to what we have here https://fbidb.io/docs/installation/ but with slightly modified commands
brew tap facebook/fb
brew install idb-companion
pip3 install --user fb-idb
  1. Add an entry to PATH that includes the path to idb (for example /Users/temp/Library/Python/3.9/bin)
  2. Update changes by source ~/.bash_profile
  3. Restart the computer

In my case, I added the PATH in ~/.zshrc (es. export PATH="/Users/xxx/Library/Python/3.11/bin:$PATH" ) and when I launch the command which idb in cmd, he gave me back the path correctly and UITest are back to working!

I just wanted to add that I and my QA team is experiencing this issue as well. We can't even get the "work around" working: installing idb-client manually. We still get the "native error: file not found" error when trying to run UI tests.

One note: when I installed idb-client, it installed to a different path than my QA engineer's install, so maybe related to not finding required files if install location is not consistent?

Here are the steps I took to solve the problem.

  1. Update Xamarin.UITest to version 4.3.3
  2. Make sure you have Python installed in version 3.6 or higher
  3. Make sure you have pip installed
  4. Install idb according to what we have here https://fbidb.io/docs/installation/ but with slightly modified commands
brew tap facebook/fb
brew install idb-companion
pip3 install --user fb-idb
  1. Add an entry to PATH that includes the path to idb (for example /Users/temp/Library/Python/3.9/bin)
  2. Update changes by source ~/.bash_profile
  3. Restart the computer

In my case, I added the PATH in ~/.zshrc (es. export PATH="/Users/xxx/Library/Python/3.11/bin:$PATH" ) and when I launch the command which idb in cmd, he gave me back the path correctly and UITest are back to working!

Hi, I Tried this, it provides the correct path in cmd but when I run the UITest I am still getting error Cannot find the specified file. Would you know what I missed?

Here are the steps I took to solve the problem.

  1. Update Xamarin.UITest to version 4.3.3
  2. Make sure you have Python installed in version 3.6 or higher
    ... ... ...
  3. Add an entry to PATH that includes the path to idb (for example /Users/temp/Library/Python/3.9/bin)
  4. Update changes by source ~/.bash_profile
  5. Restart the computer

In my case, I added the PATH in ~/.zshrc (es. export PATH="/Users/xxx/Library/Python/3.11/bin:$PATH" ) and when I launch the command which idb in cmd, he gave me back the path correctly and UITest are back to working!

Hi, I Tried this, it provides the correct path in cmd but when I run the UITest I am still getting error Cannot find the specified file. Would you know what I missed?

What worked for me was to start VS from the console, where IDB was proven to be discoverable in PATH: e.g. just run "open -n /Applications/Visual\ Studio.app".

Still, although it solves the issue and my tests start to run, they are very unstable and fail so often that are still unusable...

Here are the steps I took to solve the problem.

  1. Update Xamarin.UITest to version 4.3.3
  2. Make sure you have Python installed in version 3.6 or higher
  3. Make sure you have pip installed
  4. Install idb according to what we have here https://fbidb.io/docs/installation/ but with slightly modified commands
brew tap facebook/fb
brew install idb-companion
pip3 install --user fb-idb
  1. Add an entry to PATH that includes the path to idb (for example /Users/temp/Library/Python/3.9/bin)
  2. Update changes by source ~/.bash_profile
  3. Restart the computer

In my case, I added the PATH in ~/.zshrc (es. export PATH="/Users/xxx/Library/Python/3.11/bin:$PATH" ) and when I launch the command which idb in cmd, he gave me back the path correctly and UITest are back to working!

Hi, I Tried this, it provides the correct path in cmd but when I run the UITest I am still getting error Cannot find the specified file. Would you know what I missed?

Do you have retry the 4 point ?
PS: I have the 3.9 Python version

It worked for me, I started VS from the console. Thanks!

Moshex commented

@sjavashev
I want to say thank you for sharing
"What worked for me was to start VS from the console, where IDB was proven to be discoverable in PATH: e.g. just run "open -n /Applications/Visual\ Studio.app"."
That was the ticket for me to get this working.
@christian26A and @sjavashev
Do we have to run this command now every time we start VS for mac? is there a way to do the install for VS for mac so that the command is not needed?

Also, question for everyone on this thread, Have you guys been able to Xamarin.UITest version 4.3.3 on a Physical device and not a Simulator?
When I run Xamarin.UITest on a Physical device I get this error:


System.AggregateException : One or more errors occurred. (Failed to install DeviceAgent

ExitCode: 1
Failed to install application DeviceAgent-Runner.app 0xe8008015 (A valid provisioning profile for this executable was not found.). Last event {Error => ApplicationVerificationFailed, ErrorDetail => -402620395, ErrorDescription => Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.jBrAZy/extracted/DeviceAgent-Runner.app : 0xe8008015 (A valid provisioning profile for this executable was not found.)})
  ----> Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Failed to install DeviceAgent

ExitCode: 1
Failed to install application DeviceAgent-Runner.app 0xe8008015 (A valid provisioning profile for this executable was not found.). Last event {Error => ApplicationVerificationFailed, ErrorDetail => -402620395, ErrorDescription => Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.jBrAZy/extracted/DeviceAgent-Runner.app : 0xe8008015 (A valid provisioning profile for this executable was not found.)}

However, on an iOS simulator, it works just fine. Any input is appreciated Thank you!

@sjavashev I want to say thank you for sharing "What worked for me was to start VS from the console, where IDB was proven to be discoverable in PATH: e.g. just run "open -n /Applications/Visual\ Studio.app"." That was the ticket for me to get this working. @christian26A and @sjavashev Do we have to run this command now every time we start VS for mac? is there a way to do the install for VS for mac so that the command is not needed?

Glad it worked! :)

On your question: There was a suggestion here, and although the proposed path didn't work for me, the approach sounds good, so you may try it, or try placing the sym-link in some other location that is accessible by default with dot-net's "Process.Start".

Moshex commented

@sjavashev
Thank you for your reply. I tried this command " ln -s /Users/builder/Library/Python/3.11/bin/idb /usr/local/bin " and it did copy the IDB but it did not fix the issue. so I guess for now ill have to keep using "open -n /Applications/Visual\ Studio.app" till this issue is fixed.

Hi all,
Xamarin.UITest 4.3.4 has been released with fix for this issue.

Hi all, Xamarin.UITest 4.3.4 has been released with fix for this issue.

It should be acknowledged that this issue (with iOSDeviceManager) is "fixed", but by removing it entirely, leaving Xamarin.UITest non-functional unless the developer:

  1. Installs Python, 2) Installs Homebrew, 3) Installs two Facebook libraries, 4) messes with bash or zsh profiles, 5) launches Visual Studio via Terminal in order to work. Oh and good luck ensuring you've done this with the correct undocumented versions of each...

I hope the AppCenter team realizes that this is unacceptable, and should consider embedding all of its requirements within the Xamarin.UITest package/nuget so that updates and changes to any of the above don't magically break everyone's UI Testing

But that is another issue I guess...

Moshex commented

@dsmitchell @IlyaBausovAkvelon

I have done a full documentation on the issues on Xamarin.UITest 4.3.4 is seen in the link below. This version does not seem to be usable.

#2606 (comment)