How to deploy app on Iphone (Xamarin Forms)


You must need a subscription of Apple Developer Account which is of 99$/year.

We have to divide this procedure in 4 simple steps.

a) First of all we will create a certificate in Mac(Signing identity).
b) After signing in the developer account,we will create a new App Id.
c) Add devices in the Device options in Apple Developer Account
d) In the end we will create a provisioning profile and install it on the mac.


a) First of all we will create a certificate in Mac(Signing identity). 

   There are 2 ways of creating a signing certificate
   > Through Xcode(We will follow this approach)
   > Through Developer Account  

1. Choose Xcode Menu >Preferences...
2. Click the Accounts tab.
3. Click the + button and select Add Apple ID... from the popup menu:

 






4. If you have an Apple ID, enter the Apple ID and password, and click the Sign In button:
5. Otherwise, click Create an Apple ID and follow the steps to create a new Apple ID. Note that you will be able to log in here, regardless of if your Apple ID is connected to a Developer Program. If it's not, you can either sign up for one by visiting the Apple Developer Portal or use Free Provisioning.
Select the team, and click Manage Certificates:


6. Xcode will display all the Signing Identities that are associated with your account. Click the plus(+) and select the type of signing identity required to create a new certificate. Note that the offerings may differ to those shown in the screenshot depending on the type of account:



7. Apple may prompt you to Review and Accept any updated license agreements before you will be allowed to create a new development certificate. If this is the case, the error message below will be displayed:


8. Log on to the Developer Center to accept this license:


9. Depending on the team privileges of the Apple account, the signing identity will be generated, or a team agent or admin approve it. Note that there is not always visual feedback on this part of the process, and so the best way to confirm that the signing Identity has been created is by browsing to the Keychain Access application, and searching for the certificate, as shown below:
b) After signing in the developer account,we will create a new App Id.

1. In the developer portal browse to the Certificate, Identifiers and Profiles section in the Apple        Developer Center. Select App IDs under Identifiers.

2.  Click the + button and provide a Name:

3. The App prefix should be preset. Select Wildcard App ID for the app suffix. Enter a Bundle ID in the format com.[DomainName].*:

4. Click the Continue button and following the on screen instructions to create the new App ID.
5. Prefer Explicit App Id if you are confuse while selecting one option from the above.

c) Add devices in the Device options in Apple Developer Account
1. Click the Certificates, Identifiers & Profiles link:
2. Click on the Devices link:

3. Click the + button:

4. Provide a name for the new device and paste the device Identifier that we copied above into the UUID field:

5. Click the Continue button.
6. Finally, review the information and click the Register button:

7. Repeat the above steps for any iOS device that will be used to test or debug a Xamarin.iOS application.
 After adding the device to the developer portal, it is necessary to create a provisioning profile and add the device to it.


d) In the end we will create a provisioning profile and install it on the mac.

1. Use Safari to browse to the Apple Developers Member Center, and under the section Certificates, Identifiers & Profiles select Provisioning Profiles.
2. Click the + button, in the top right corner to create a new profile.
3.From the Development section, select the radio button next to iOS App Development, and press Continue:

4. From the dropdown menu, select the App ID that to use:

5. Select the Certificate(s) to include in the provisioning profile, and press Continue:

6. Select all the devices that the app will be installed on.

7. Provide the Provisioning Profile with an identifiable a name, and press Continue to create the profile:

8. Press Download to download the provisioning profile onto a Mac:


9 Double-click on the file to install the provisioning profile in Xcode. Note that Xcode might not show any visual clues that it has installed the profile except for opening. This can be verified by browsing to Xcode > Preferences > Accounts. Select your Apple ID and click View Details.... Your new provisioning profile should be listed, as illustrated below:


10. After the provisioning profile has been successfully created it may be necessary to refresh Xcode so that all the development certificates are available to Visual Studio for Mac and Visual Studio.

Note: It is important to install the provisioning profile by simply clicking it.There will be no visual effect,but the provisioning profile would be installed.After that restart visual studio to see the changes implemented.


Deploying the app

1.Plug the device in to a Mac.
2. In the project's Info.plist, make sure the Bundle Identifier matches the App ID:


3. Right-click on the project to view the Project Options dialog, and browse to Build > iOS Bundle Signing. From the drop-down list next to both the Signing Identity and Provisioning Profile verify that Visual Studio can see the correct profiles, and select a specific identity & profile.
4. If this is set to Automatic, Visual Studio will select the identity and profile based on the Bundle ID that was set in step #2.
5. Make sure to set the build configuration to iPhone or iPad, rather the simulator.
6. Click Run in Visual Studio and view the app running on the device.

For any query or suggestion,please comment

Comments

  1. Thanks for this tips, I was searching for the solution for months. This is an awesome tech solutions. Thanks for the genius tip.

    ReplyDelete

Post a Comment

Popular posts from this blog

FilePicker In Xamarin Forms

How to Use Media Picker In Xamarin Forms Portable

Scrolling Problem ListView in ScrollView (Solved)