Deploy Xamarin App to iOS Device - ios

I can deploy my Xamarin Forms app to an iOS simulator with no problem but now I would like to deploy to a device.
I have followed the instructions to do this here:
https://developer.xamarin.com/guides/ios/getting_started/installation/device_provisioning/
I get to the point where I create a provisioning profile and download the .mobileprovision file, then I open the file and it opens with xcode but I get no confirmation that the file has been imported.
On a windows machine with visual studio, I try to deploy my app to a device I get the following error:
When I look for the provisioning profile in XCode there doesn't appear to be one, despite importing the provision file:
Does anyone have any idea what might have gone wrong here?

I've got this working now and I'm posting an answer because I think there are a couple of things that the Xamarin instructions don't make very clear.
The first issue is that the device you want to deploy your app onto must be attached to you apple device. It won't copy the assemblies to a windows development machine and deploy from there.
The second is that you have to supply an identifier in the iOS project properties, iOS Application tab, and the identifier must match what was specified in your App Id profile.
I hope this helps others out.

Related

Xamarin Deploying iOS App Ad Hoc Failing to Install

I am trying to deploy an iOS app Ad Hoc to an iPhone for beta testing. I've been developing the app on Windows VS, I have a Macbook air with all the necessary software (Xcode, VS, etc), and I have paired to it with VS on my Windows machine. I have also followed the following steps:
Created an Apple Developer account
Created an App ID with the bundle identifier as the same exact one as the one in info.plist
Created a signing certificate using my Macbook Air, downloaded it, and installed it into XCode
Created a provisioning profile with the App ID and the certificate, and made sure to include the device that I want to load the app onto.
Made sure everything above was set to "distribution" and "ad hoc" as needed.
Set Bundle Signing in my iOS project properties to Manual Provisioning, and selected the Signing Identity and Provisioning Profile to the ones that I created for this deployment.
Set the build to Release and the target to Remote Device
Ensured that the deployment target in info.plist was set to the highest available, which is 15.4, though my iPhone is at 15.6 (could this be the problem?)
Set the IPA Packaging Options to "Build iTunes Package Archive (IPA)"
Set "Include iTunesArtwork images and the iTunesMetadata.plist" to true in the same area
Successfully built the iOS project and produced a .ipa file
After all that, I've been trying to get the .ipa onto my phone, which is definitely the device I added to the provisioning profile.
I've tried two methods to do this, and both have failed:
Connecting my phone to my Windows machine and opening iTunes. Dragging the .ipa file onto the device. The app shows up on my phone, but when I try to open it, I get this error:
"This app could not be installed because its integrity could not be verified". Though it should have been.. The device is linked to the provisioning profile that was used to create the darn thing.
Connected my phone to my Macbook Air and accessed the device through XCode > Window > Devices and Simulators. I emailed myself the .ipa file and downloaded it onto the machine (the Microsoft docs explicitly state that emailing the .ipa should work just fine). In the "Intalled apps" section of the device, I clicked the little '+' and then pointed it to the downloaded .ipa. After a few seconds, it pops up an alert window that says "Unable to install *.iOS".
Other things I have tried since this has been a problem:
Recreating the above steps by re-registering my device, creating new certificates, downloading, installing, all that business.
Messing with the deployment target version.
Jumping out from behind the couch and startling it to make it do what it's supposed to.
I swear I'm done with Xamarin forever after this problem is solved, but all the headaches I've experienced have made me think twice about whether to even bother with .NET Maui haha thanks for any help you can provide
Firstly, the error This app could not be installed because its integrity could not be verified" may be caused by the proper certificate or the test devices are not visible in 'Devices' (UDIDs added) in developer.apple.com/account.I found two simialr issues, you can refer to them: link1, link2.
Secondly, have you follow this docs on how to generate the IPA file?

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.

(Xcode/iOS) Provisioning profile contained invalid application identifier

I've never had this issue before. All of my experiences for just deploying app from Xcode to my iPhone is so flawlessly. I have 2 iPhones, with the same Apple ID. I used to deploy app from Xcode to those iPhones with no issue.
Today I had been experiencing this issue, error "Provisioning profile contained invalid application identifier" and "No profiles for 'com.****.****' were found" when I was trying to deploy an app to iPhone. But deploying to iOS Simulator is not a problem.
2 or 3 days ago, I had done deploying an app (from old project) to my first iPhone, and no problem. Today (this morning) I want to test the app to my second iPhone, but got those issue. Oddly, I still can deploy to my first iPhone since I have deployed it a few days ago and it still works.
Confused, maybe there is a problem with my second iPhone. I just create a new and fresh simple project to test deploying to my second iPhone. The result is failed and I got the same issues. When I test to my first iPhone, BOOM I got THE SAME ISSUE!
Now, I cannot deploy any app from new project to all of my iPhones. Some old apps that still work still can be deployed. But when I create a new project and try to deploy to all of my iPhone, always error. When I deployed it to Simulator, there is no such error.
Anyone knows the problem? Please help me. Thanks.
ssimage1
ssimage2
This seems to have been a problem on Apple's side as the issue "magically" fixed itself for me after writing to the developer.apple.com support yesterday. Please try again now (and let us know whether it works).
To debug the issue in case it happens again, I would suggest:
looking at https://developer.apple.com/system-status/ to see whether "Certificates, Identifiers & Profiles" is working (in my case, no problem was reported there, despite the error...)
logging into a newly created local user account and creating a new iOS app project (e.g. from the Single-View template). Then try running the application on an iPhone with "Automatically manage signing" checked.
If there is no reported error and the installation fails, you can contact the developer support knowing you have done (almost) as much as possible to rule out potential already-reported or local issues.
// check your Project bundle identifier is exist on your Apple developer Account?
// for check bundle id
if you have developer Account, login with credentials, -> when you are login, so you can see there options, choose create certificate -> click on identifier and see is there any your project bundle exist or not , if not create certificate , add identifier , device Udid , provisioning profile and download it ,double tap to add in your project,
if you do not have developer you cannot add bundle id
i have some ref link to create certificates :- https://appaloosa-store.readme.io/docs/getting-started-with-apple-certificates

iOS app upload to iTunes Connect results in Invalid Signature issue

I'm working on a hybrid mobile app project (Ionic framework) and releasing to Android, iOS and web. This issue concerns only releasing the application on iOS.
I ran into an issue whereby I suddenly started getting the following email from iTunes Connect after building, archiving and uploading my iOS app to App Store from Xcode.
App Store Connect: Your app "YourAppName" (Apple ID: XXXXXXXXXX) has
one or more issues
Dear Developer,
We identified one or more issues with a recent delivery for your app,
"YourAppName". Please correct the following issues, then upload again.
Invalid Signature - A sealed resource is missing or invalid. The file
at path [YourAppName.app/YourAppName] is not properly signed. Make sure you
have signed your application with a distribution certificate, not an
ad hoc certificate or a development certificate. Verify that the code
signing settings in Xcode are correct at the target level (which
override any values at the project level). Additionally, make sure the
bundle you are uploading was built using a Release target in Xcode,
not a Simulator target. If you are certain your code signing settings
are correct, choose "Clean All" in Xcode, delete the "build" directory
in the Finder, and rebuild your release target. For more information,
please consult
https://developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html
Best regards,
The App Store Team
I tried everything I could find on the internet regarding this issue:
Checking over my certificates, provisioning profiles, recreating them, updating Xcode, building the project again, made sure I'm using a distribution certificate not an ad-hoc certificate, verified the code signing settings in Xcode were correct, verified the bundle was built using the Release target, tried the "Clean All" option, deleted the "build" directory in the finder and rebuilt the release. In short - I tried everything I could find by Apple regarding this issue, also looked up the same issue in StackOverflow and tried a huge variety of the recommended solutions. I tried all of those options multiple times over to make sure I didn't miss anything.
Nothing worked...
Also a note that I was able to upload to App Store without any problems before. There hasn't been any changes to the project which could result in this Invalid Signature issue arising - no certificates have expired, no new ones have been created, no new provisioning profiles have been created. The same profiles and certificates were used which worked just fine some time ago. iTunes Connect just suddenly started responding with this issue.
What else can I try?
I was sceptical at first when I tried this solution but this actually solved my issue.
Find a spare USB stick or an external hard drive.
If your Mac's filesystem is APFS format the external volume using a HPFS Mac OS Extended (Journaled) file system. Move your project over to the freshly formatted HPFS external volume and rebuild it over there. This is important as if you build it on your Mac's APFS volume and then move it over to your HPFS external volume to archive and upload in Xcode this will not work!
The project needs to be built, signed, archived and uploaded ON the HPFS volume.
The uploading to App Store should now work again. It worked for me, hope it works for you as well.
See more information on the solution here

How to create Deployment package for iOS using Marmalade

I am using Windows7 and Marmalade 5.1.10. I tried to create deployment package for iOS but it is giving error of certificate not found at particular location. I checked in that location and there is one .cer file presents. I installed that certificate under trusted root authorities store. Still I am getting same error. Then I copied that and renamed .cer file to AppleWWDRCA.cer file as per given in error message. After that it is giving me error:
"Signing error: Can't find your developer signing private key at C:\Marmalade\5.1\s3e\deploy\plugins\iphone\certificates\developer_identity.key".
Let me know how to resolve this issue.
Note that I dont have Apple ID created for iOS developper.
Please share your input on this.
What if I just want to test with iPhone simuulator? I tried following:
I created my simple demo application. Then I created package for iPhone on my Windows PC. While creating package I selected option "Do Not Sign". I got success with that. Then I transfered .app to my MacMini. I copied .app to XCode in appropriate folder of Application. Then I started iPhone Simulator and I can see my application. But when I click on that it is not opening.
So now let me know what can be issue. Is it due to certificate issue or due to selected option "Do Not Sign"?
Please treat this as little bit urgent.
Thank you very much in advance for your inputs.
Regards,
Premal Panchal
There is a detailed description of how to create the necessary certificate files in the Marmalade Documentation help file, installed as part of the SDK. You can find it here:-
Marmalade->Platform Guides->iOS Guide (for iPhone, iPad, iPod)->iOS Requirements and Setup Guide
When you say you don't have an Apple ID created for iOS Developer do you mean you haven't signed up to the iOS Developer Program? If so, then you won't be able to generate a signed build at all.
Regarding testing with the iPhone simulator, I don't think that this is possible. If it is possible you will probably need to have a signed app. I believe the reason XCode can run in the iPhone Simulator even without valid developer certificates is that it is doing it's own signing of the generated app behind the scenes.

Resources