Xamarin VS2019 cannot test iOS app using paired mac - ios

I have a xamarin project in VS2019 on a windows pc, that I am trying to test on a paired mac.
When I try to start testing the app in the simulator I get the following message:
Xamarin Simulator
Failed to install
//Users/administrator/Library/Caches/Xamarin/mtbs/buildsxxx.Touch/c186893d4554f91f3322b4d0409a1518/bin/iPhoneSimulator/Debug/xxxTouch.app
to D18C5658-ECBB-4492-A7B9-14710340A89F. The app directory
'/Users/administrator/Library/Caches/Xamarin/mtbs/builds/xxx.Touch/c186893d4554f91f3322b4d0409a1518/bin/iPhoneSimulator/Debug/xxxTouch.app'
does not exist.
What is meant by this? Does it mean there are no built files on the mac? Is there a folder missing in the iPhone simulator?
Sometimes I do also get the following error:
Could not find any available provisioning profiles for ApplicationName
on iOS.
Is it really necessary to have this provisioning since I just want to test it on a virtual device?
I am running the app using the debug profile and the iPhoneSimulator
Thanks for any help!

Thank you for the suggestions!, Finally I was able to get it to work simply by using the automatic provisioning in the IOS bundle signing project properties tab.
I read that you could not use this option without a apple developer program account.
I don't have a developer program account, but it seems to work nonetheless.

Related

Errors when trying to 'Archive' IOS flutter app

I am new to IOS app development and this is my first time publishing an app (test flight). When archiving the app it gives me two errors.
Failed to create provisioning profile.
There are no devices registered in your account on the developer website. Plug in and select a device to have Xcode register it.
No profiles for '(mypackagename)' were found
Xcode couldn't find any iOS App Development provisioning profiles matching '(myPackageName)'.
It may be useful to note that I cannot use a physical device as I am connecting to a mac using MacInCloud.
I am not sure what other details you need but feel free to ask.
Any help is greatly appreciated.
Thanks

Visual studio unable to locate provisioning profiles for Xamarin.iOS

I am trying to setup my environment to deploy my app to a real IPhone for testing because I dont want to work with simulators and etc. It apparently requires provisioning profiles. I dont have a paid apple developer account and I learned that it is not required. These are the steps I have done so far:
Open xcode on my mac go to Preferences> Accounts> Add new Apple ID. I added one of my apple IDs.
I then added a new project select a team and selected necessary options to create the project
I went to project propertiesi setup the iOS version.
I went to signing and enabled automaticly manage signing. It did something and created a certificate for me.
I deployed the app once to my phone which worked fine.
I later opened visual studio on my windows machine.
Paired my mac with my visual studio.
Went to info.plist and copied my bundle identifier from xcode to visual studio.
Enabled Manual provisioning but no developer profiles. Restarted VS but no luck
I basically followed this site
https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/free-provisioning?tabs=windows
I tried without selecting a specific provisioning profile (it was in developer (automatic))
It seemed to be going well until it gave this error
error MT1007: Failed to launch the application '/Users/xxxxxxx/Library/Caches/Xamarin/mtbs/builds/App8/4ae6e8b79af6f5c06054809bff907c4f900782cdb32378817eb5bbdd1fa2e996/bin/iPhone/Debug/device-builds/iphone11.8-14.2/App8.app' on the device 'iPhone': Failed to launch the application 'com.xxxxxxxxxxxxxx.App8' on the device 'iPhone': Invalid Service Error (error: 0xe8000022) 0
I found the solution to my problem. The site https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/free-provisioning?tabs=windows showed illustrations of choosing specific provisional profiles
However I didn't get this kind of choosing
Mine had
Developer (automatic)
No profiles found (or something in english: my VS is not in english)
but apparently it is not required to choose the exact profile from VS. I was able to deploy the app by just compiling the app as usual (after following the steps of course). However there is a problem with launching the app which requires me to go to settings and trust my apple id or something which is not important.

Error with installation IOS app to device builded in VS with Xamarin

I try to build app, created in VS with Xamarin, to test it on real device (on iPhoneSimulator it works without problem). I use AdHoc build with all needed certificates and provisions (created like Xamarin tutorial describes). But when I try to upload IPA file to device through ITunes, it finish unsuccessfully. On iPhone it just disappear after uploading complete, on iPad it throw error message with "Application is unable to be install". Both devices was added to provision profile. Provision profile is active.
All help will be appreciated
You can find a more descriptive reason if you open the "Deploying to Device" Window
Problem was solved this way - copied project to Visual Studio for Mac, installed on host-build machine, building app, move project back. Now app is uploading without problems.

Xamarin fails to deploy iOS app to iOS Device

I am trying to deploy my Xamarin iOS app to iPhone. But it fails to deploy into iPhone devices where as it works fine in Simulators. I verified that Bundle Identifier and Provisioning Profiles are matching. Also I deployed another test app into iPhone devices using XCode using the same provisioning profiles. It is getting deployed successfully. Also approved the Developer as trusted in iPhone.
The Exception I see Visual Studio as below
error MT1006: Could not install the application
'/Users/VarunRaja/Library/Caches/Xamarin/mtbs/builds/WK.TAA.Mfa.OTPAuthenticator.iOS/116dd0bfdd565dd44e1837c2280a6d94/bin/iPhoneSimulator/Debug/WK.TAA.Mfa.OTPAuthenticator.iOS.app'
on the device 'Raja’s iPhone': AMDeviceSecureInstallApplicationBundle
returned: 0xe8000067 (kAMDAPIInternalError).
I see this is coming from my Mac Agent. Visual Studio says the App is terminated.
As mentioned here by Tim Wheeler, it is an indication that your device is not in your provisioning profile, or your provisioning profile is invalid.
Why?
Basically, iOS will not let you build the app on to the device for security purposes, unless you have registered the device to THAT particular app in the Apple Developer Portal. They have no issues with you installing it on a simulator, so that you can't distribute apps without using the App Store.
Fix
In order to fix this, you need to have Access to the Apple Developer Portal of the company under which the app is registered and then go to the Certificates, Identifiers and Profiles.
Go to the "Devices" tab and make sure your device is in the list. Then go to "Profiles" tab, and you might see an "Invalid" status under the Expiration column of the Provisioning Profile. Fix it, tap on your app's profile, ensure it includes your iPhone, downloaded the new one to the mac and install it.
Not fixed yet?
If that was not the issue, it could be because you have multiple provisioning profiles installed. Visual Studio is usually set to Automatically determine the appropriate provisioning profile, and it could be using the wrong one if you have a few installed. You could delete the unneeded ones, or you can go to your iOS project settings, set the bundle signing to "Manual", then choose the valid profile.
Try to change Linker Behavior to Link SDK assemblies only
Go to the iOS properties => iOS Build and set "Linker Behavior" to "Link Framework SDKs Only" and "Supported Architectures" to "ARMv7 + ARM64"
Create blank project on your build mac host, or mac, xcode. Set bundle id to xamarin bundle id. Build and deploy from xcode, close and try again with xamarin.

Unable to test on iPhoneSimulator with Xamarin Studio

I'm currently developping an app on Xamarin Studio with Xamarin.Forms the app works fine in android but on ios i can't even build my app ...
At first i had the "no valid ios code signing keys found in keychain" error so i did add my Apple Id on XCode has I saw on a forum and I did follow the tutorial on how to add a developer certificate i did refresh my provisioning profiles on xcode and added them all (iOS Development, iOS Distribution, Developer ID Application, etc) .
Now I have another error still on build that say "Error executing task DetectSigningIdentity: Directory '/Users/.../Library/MobileDevice/Provisioning Profiles' not found."
I don't understand since i'm just trying to execute it on the iPhoneSimulator in Debug mode and i should have the certificate iOS Developer ....
Any idea on how to solve this ?
Create a new solution in XCode with the same bundle identifer as your xamarin project. After creating a new solution you get a new page where you can click on fix issue.
Connect your apple device and click on fix issue it will maybe solve your problem
You are actually very close. Now that you have created your provisioning profiles, all you have to do is download them (or at least one) and execute them. That will automatically place the profile at the path that is reported on your error. After that you'll be good to go.

Resources