Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to deploy to iphone iOS 17.2.1 from VS 2022 #19738

Open
bluebeenet opened this issue Jan 7, 2024 · 26 comments
Open

Unable to deploy to iphone iOS 17.2.1 from VS 2022 #19738

bluebeenet opened this issue Jan 7, 2024 · 26 comments
Labels
area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging delighter-sc partner/macios Issues for the Mac / iOS SDK platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue t/bug Something isn't working

Comments

@bluebeenet
Copy link

Description

Unable to deploy to iPhone.

My iPhone is running on version 17.2.1 and Xcode is in version 15.0.1

VS: Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.8.3

error MT1045: Failed to execute 'devicectl': 'devicectl -j /var/folders/tm/cvmpfvmd5rzbj3kxllwxvrpc0000gn/T/tmpLjdv45.tmp device install app --device iPhone /Users/mauricio/Library/Caches/Xamarin/mtbs/builds/MauiApp1/c5f00f28fc519043c8b48615aef3bd17c3569b03515f36c03ce7903b6e35fb80/bin/Release/net8.0-ios/ios-arm64/MauiApp1.app' returned the exit code 1.

Steps to Reproduce

  1. Create a new .NET MAUI App
  2. Connect to your iphone device running the latest OS version
  3. Run to deploy to the phone.

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.3

Affected platforms

iOS

Affected platform versions

iOS 17.2.1

Did you find any workaround?

No response

Relevant log output

No response

@bluebeenet bluebeenet added the t/bug Something isn't working label Jan 7, 2024
@drasticactions drasticactions added the s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue label Jan 8, 2024
@ghost
Copy link

ghost commented Jan 8, 2024

Thanks for the issue report @bluebeenet! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.

If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.

  1. Go to the Visual Studio for Windows feedback tool or Visual Studio for Mac feedback tool to report the issue
  2. Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.

@samhouts samhouts added the potential-regression This issue described a possible regression on a currently supported version., verification pending label Jan 9, 2024
@McLuce
Copy link

McLuce commented Jan 11, 2024

Im experiencing the same problem, except that I am using XCode Version 15.2 and Microsoft Visual Studio Professional 2022 (64-Bit) Version 17.8.4.

I tried using an older XCode Version or just older Xcode command line tools.
Nothing worked so far.

@bluebeenet
Copy link
Author

Visual Studio Community 2022 (64-bit) - Current Version 17.8.4

error MT1045: Failed to execute 'devicectl': 'devicectl -j /var/folders/tm/cvmpfvmd5rzbj3kxllwxvrpc0000gn/T/tmpsTuq0n.tmp device install app --device iPhone /Users/mauricio/Library/Caches/Xamarin/mtbs/builds/MauiApp1/c5f00f28fc519043c8b48615aef3bd17c3569b03515f36c03ce7903b6e35fb80/bin/Debug/net8.0-ios/ios-arm64/device-builds/iphone12.1-17.2.1/MauiApp1.app' returned the exit code 1.

@MichaelSL
Copy link

Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.9.0 Preview 2.1

VS connected to Mac build host and I have the same issue.
I can't check on Mac because of the Rider deployment bug

@McLuce
Copy link

McLuce commented Jan 18, 2024

I found some news regarding this issue on developercommunity.visualstudio.com.
This is what was postet:

A fix for this issue is now available in preview release. Try out the fix by installing the most recent preview from https://visualstudio.microsoft.com/vs/preview/ .

Right now I can't yet confirm or deny that the solution works. If you try it out, please let me know if it works for you.

@Ryano84
Copy link

Ryano84 commented Jan 19, 2024

I found some news regarding this issue on developercommunity.visualstudio.com. This is what was postet:

A fix for this issue is now available in preview release. Try out the fix by installing the most recent preview from https://visualstudio.microsoft.com/vs/preview/ .

Right now I can't yet confirm or deny that the solution works. If you try it out, please let me know if it works for you.

Unfortunately I received the same error with the Version 17.9.0 Preview 3.0 as well

@bluebeenet
Copy link
Author

Resolved
Update to VS: Microsoft Visual Studio Community 2022 (64-bit) - Version 17.8.5
Update to Xcode version 15.2 and download iOS 17.2 Simulator

@lomdar67
Copy link

lomdar67 commented Jan 24, 2024

Same problem here VS Enterprise 17.8.5 (64-Bit), Xcode 15.2

@samhouts samhouts added area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging partner/macios Issues for the Mac / iOS SDK labels Jan 25, 2024
@McLuce
Copy link

McLuce commented Jan 26, 2024

The issue is resolved for me with VS Version 17.8.5 and everything is working fine now.

@zilvfes
Copy link

zilvfes commented Feb 9, 2024

I'm having this issue on VS Version 17.8.6, xcode15.1 and xcode15.2

@TheBaileyBrew
Copy link

I have the same issue on my M1 Mac.

Using Rider 2023.3.3, xcode 15.2 & xcode 15.3beta

@MAUIoxo
Copy link

MAUIoxo commented Feb 23, 2024

Same problem here, but I am already on VS 2022 17.10.0 Preview 1 and Xcode 15.2. What’s the solution now? This is blocking my own development. Recently just bought a new Mac to being able to develop again as got an error message that I need to upgrade to new Xcode which wasn’t possible back then. In the meantime it was working also with deploy, now again not working within a couple of days - real annoying working with all that

@lomdar67
Copy link

lomdar67 commented Feb 23, 2024

If you get an error like this:
error MT1045: Failed to execute 'devicectl': 'devicectl -j /var/folders/tm/cvmpfvmd5rzbj3kxllwxvrpc0000gn/T/tmpLjdv45.tmp device install app --device iPhone /Users/mauricio/Library/Caches/Xamarin/mtbs/builds/MauiApp1/c5f00f28fc519043c8b48615aef3bd17c3569b03515f36c03ce7903b6e35fb80/bin/Release/net8.0-ios/ios-arm64/MauiApp1.app' returned the exit code 1.

copy the complete devicectl command, head over to the mac open a terminal window and execute it with xcrun like so:

xcrun devicectl -j /var/folders/tm/cvmpfvmd5rzbj3kxllwxvrpc0000gn/T/tmpLjdv45.tmp device install app --device iPhone /Users/mauricio/Library/Caches/Xamarin/mtbs/builds/MauiApp1/c5f00f28fc519043c8b48615aef3bd17c3569b03515f36c03ce7903b6e35fb80/bin/Release/net8.0-ios/ios-arm64/MauiApp1.app

You will get a useful error messages there. Most of the time it will be a provisioning problem.

Don't know why it is so hard for Microsoft to show this error in Visual Studio, but it fits the whole MAUI disaster!

@MAUIoxo
Copy link

MAUIoxo commented Feb 23, 2024

Great hint 👍 I will try that

@MAUIoxo
Copy link

MAUIoxo commented Feb 23, 2024

As I deployed it with the same profile a couple of days ago, don’t know how anything could get corrupted. The profile is also not outdated as I created one from scratch just a week ago when I setup my new Mac. But, I will check this weekend

@lomdar67
Copy link

lomdar67 commented Feb 23, 2024

As I deployed it with the same profile a couple of days ago, don’t know how anything could get corrupted. The profile is also not outdated as I created one from scratch just a week ago when I setup my new Mac. But, I will check this weekend

Can also be Entitlements.plist related. Run the command on the Mac and you will have a better idea where to look for the problem!

And in any case update to the latest VS Build 17.9.0!

@MAUIoxo
Copy link

MAUIoxo commented Feb 23, 2024

I already have a newer Version an am working with VS 2022 17.10.0 Preview 1

I do not have an Entitlements.plist file. Do I need this in my project? Not sure, what this does and where to place if needed

@IceBubble
Copy link

If you get an error like this: error MT1045: Failed to execute 'devicectl': 'devicectl -j /var/folders/tm/cvmpfvmd5rzbj3kxllwxvrpc0000gn/T/tmpLjdv45.tmp device install app --device iPhone /Users/mauricio/Library/Caches/Xamarin/mtbs/builds/MauiApp1/c5f00f28fc519043c8b48615aef3bd17c3569b03515f36c03ce7903b6e35fb80/bin/Release/net8.0-ios/ios-arm64/MauiApp1.app' returned the exit code 1.

copy the complete devicectl command, head over to the mac open a terminal window and execute it with xcrun like so:

xcrun devicectl -j /var/folders/tm/cvmpfvmd5rzbj3kxllwxvrpc0000gn/T/tmpLjdv45.tmp device install app --device iPhone /Users/mauricio/Library/Caches/Xamarin/mtbs/builds/MauiApp1/c5f00f28fc519043c8b48615aef3bd17c3569b03515f36c03ce7903b6e35fb80/bin/Release/net8.0-ios/ios-arm64/MauiApp1.app

You will get a useful error messages there. Most of the time it will be a provisioning problem.

Don't know why it is so hard for Microsoft to show this error in Visual Studio, but it fits the whole MAUI disaster!

This was perfect. Simply that I had not paired my device in Xcode - the error on VST wasn't much use at all - but this made it perfectly clear. Thank you!

@chartierpw
Copy link

The command:

xcrun devicectl -j /var/folders/tm/cvmpfvmd5rzbj3kxllwxvrpc0000gn/T/tmpLjdv45.tmp device install app --device iPhone /Users/mauricio/Library/Caches/Xamarin/mtbs/builds/MauiApp1/c5f00f28fc519043c8b48615aef3bd17c3569b03515f36c03ce7903b6e35fb80/bin/Release/net8.0-ios/ios-arm64/MauiApp1.app

Is obviously for a app developed for net 8, I'm getting this issue with Xamarin.iOS, not Net 8 (yet). This release will be my final release for a Xamarin.iOS app, I'll be moving to Net 8, but in the meantime, I need to get this app out there and I can't even run it on my test device without getting this error. I started getting the error after updating VS 2022 from v17.9.6 to v17.9.7. I've created a issue in VS feedback, but they take time and time is not something I got, so any assistance anyone could provide here would be invaluable. Thanks,

@IceBubble
Copy link

If you check the error in VST on windows, that xcrun is effectively a command being passed over to the Mac. Copy that specific bit, run it on the mac (as above) and you'll get a more descriptive error. Not sure .Net 8 has any bearing as such - happy to be corrected though :)

@chartierpw
Copy link

Yes, figured it out, I was able to run the command in a terminal on the Mac, the error The command I ran is:

xcrun devicectl -j /var/folders/s7/6kd65q7x25l_gls5ny90ylf40000gn/T/tmpuWSxA6.tmp device install app --device "Prescott's iPhone (2)" /Users/prescottchartier/Library/Caches/Xamarin/mtbs/builds/OML_iOS/925fc282e7624c296284fb3051c5d4c69f7dc7a0bdbfa5fe84b98a136988d552/bin/iPhone/Debug/device-builds/iphone14.5-17.4.1/OML_iOS.app

The error is:

The specified device was not found. (com.apple.dt.CoreDeviceError error 1000 (0x3F8))

I'm assuming that the device it couldn't find is the iPhone.

The iPhone IS attached to the Mac, I can browse the iPhone via Finder and see all the information about the iPhone, not sure why it can't be "found", but it's definitely there. I cleared all trusted computers and re-trusted the iPhone from the Mac, no change. I created an issue with Microsoft, see it at here:

https://developercommunity.visualstudio.com/t/Error-MT1045-after-upgrading-to-VS-2022/10660415?port=1025&fsid=b2bfe17d-bd4e-4735-8d08-ae37caf76e1c&ref=native&refTime=1715942372826&refUserId=ebd9983e-b3e0-6b4f-9a94-60b4174c2f34

R/
Prescott ...

@IceBubble
Copy link

There were a bunch of new things I found this time around (haven't had an app on iPhone for a bit) which seemed to include enabling a new "Developer Mode" in settings, and then hooking it up to xCode (check the Devices and Simulators) where it then did a few things before being available.

@chartierpw
Copy link

Well, that did it. I opened XCode on the Mac and when I did a "Trust" dialog opened on the iPhone. I of course selected trust and I was able to deploy the app. There must have been a change when I updated XCode the other day, otherwise I have no idea how that happened. In any event, I'm back in business. Thanks for the help. Oh, btw, I never did find "Devices and Simulators" in the XCode settings, fortunately I didn't need to find it.

R/
Prescott ....

@IceBubble
Copy link

Awesome, glad you found it. Devices and Simulators is in Xcode. Open that, go to the top and select the "Window" option from the mac and then it's there. It's very handy as you can get at some of the stuff stored on the devices.

All the best, P.

@chartierpw
Copy link

Ah, I see it now. Odd place to put it, one would assume that one would find it in "Settings". Nope, Apple does it their way.

R/
Prescott ....

@mackayn
Copy link

mackayn commented May 30, 2024

Well, that did it. I opened XCode on the Mac and when I did a "Trust" dialog opened on the iPhone. I of course selected trust and I was able to deploy the app. There must have been a change when I updated XCode the other day, otherwise I have no idea how that happened. In any event, I'm back in business. Thanks for the help. Oh, btw, I never did find "Devices and Simulators" in the XCode settings, fortunately I didn't need to find it.

R/ Prescott ....

Thanks you for this, sorted my iPhone deploy issue. It's been perfectly fine deploying in Flutter so assumed all was good. I'll keep an eye on this as maybe using XCodes to swap xcode versions cause problems but can deploy to sim and iPhone reliably now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging delighter-sc partner/macios Issues for the Mac / iOS SDK platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests