Can I use an iPhone to test a Xamarin app?

Asked

Viewed 1,520 times

0

I’m learning to develop with Xamarin (Using VS 2015 and Windows). To test the app on Android is quiet, I use Genymotion. And on IOS? How can I test? Only with a physical iPhone ? Or is there an IOS emulator?

  • This server response to your question: https://answall.com/questions/164307/development-ionic-para-ios-em-um-ambiente-windows-ou-linux%C3%A9-poss%C3%Advel

  • 1

    IOS emulator only on macOS, via Xcode, unfortunately. Legally speaking, there are no other features: either you have a Mac, or you pay to use someone’s. Unofficially there are some "hacks"...

  • This link can help you with some important things... https://docs.microsoft.com/pt-br/xamarin/ios/deploy-test/app-distribution/ipa-support?tabs=windows

3 answers

2

There is no iOS emulator for development, at least not on Windows. Doing so would violate the license imposed by Apple.

In the new Visual Studio 2017 Enterprise, IE, the very expensive, has a form of test remotely with a simulator.

You can test in Macos or a service that offers the emulator remotely. The same goes for publication.

There are emulators of device, but I have the impression that this breaks iOS usage license because nor in VM can run it if the hardware is not Apple. One more collection.

2

I can use an iPhone to test a Xamarin app?

Yes, you can currently use an iPhone, as there is no iOS emulator for Windows and Linux, you can test directly on it with:

Xamarin Hot Restart

It will be necessary:

First of all Xamarin Hot Restart is disabled by default, to enable go to: Tools > Options > Environment > Preview Features > Enable Xamarin Hot Restart (i don’t know the way in English in VS)

Limitations:

  • Only iOS apps built with Xamarin.Forms and iOS devices are currently supported

  • Only 64-bit iOS devices are supported. Starting with "iOS 11", Apple no longer allows running iOS applications on the 32-bit architecture (devices prior to "iPhone 5s")

  • The archives Storyboard and XIB are not supported and the application may crash if you try to load them while running. Use the "HOTRESTART" preprocessor symbol to prevent the execution of this code

  • Libraries and "iOS" static structures are not supported and you may see runtime errors or crashes if your application tries to load them. Use the pre-processor symbol HOTRESTART to prevent the execution of this code. Dynamic iOS libraries are supported

  • You cannot use "Xamarin Hot Restart" to create application packages for publication. You will still need a Mac machine to do a full build, signature and deployment of your application to producing, i.e., the focus here is only development and testing

  • Asset catalogs are not currently supported. When using "Xamarin Hot Restart", your application will show the default icon and the startup screen for Xamarin applications. When paired with a Mac or developing on a Mac, your Asset Catalogs will work

Despite the limitations is easier than running a VM (hackintosh) and probably the cost-benefit and real-time debugging will be much easier, of course when publishing will need a real Macos

As the Apple stated, that as of March 2019 all apps and updates sent to the App Store must have been developed with iOS 12.1 SDK or later, included in Xcode 10.1 or later. Apps should also be compatible with iPhone XS screen sizes and 12.9 for iPad Pro.

Configuring

  1. Make sure the iOS project is set to the startup project and the build configuration is set to Debug|iPhone

  2. If this is an existing project, go to Build > Configuration Manager... and make sure that Deploy is enabled for the iOS project

    visual studio local device iOS

  3. Connect an iOS device to your computer. If a device is already connected, disconnect and reconnect it. The device name will appear in the wizard as soon as it is detected. Click Next

  4. Enter the credentials of your developer account from Apple and click Next

  5. Select a "team" using the drop-down menu to enable the Automatic provisioning in the project. Click Finish.

  6. If the device does not appear connect again, then it should appear connected in the debug destination drop-down menu. To debug your application, select your device from the drop-down list and click the button Run

  7. To restart you can use the shortcut Ctrl+Shift+F5 or click Restart:

    Reiniciar o Xamarin Hot Restart

2

To perform tests through the "simulator" of the iphone you will need to own a Mac or a Mac rental service such as Macincloud to perform the compilation of your application, using Xamarin Mac Agent in visual Studio.

Xamarin Mac Agent Configuration https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/

Recently Microsoft announced the Xamarin Live Player, which allows you to perform tests on your Android or iOS phone, through this application, is a good solution if you do not have a Mac for development, remembering that even using this product, you will need a Mac to compile and publish to the Appstore.

More information: https://www.xamarin.com/live

Xamarin Live Player has several limitations, so complex applications with advanced features may not work very well.

I recommend using this resource for simple applications at the moment, because I believe they will improve this solution over time.

You have these options today, see which one fits your scenario.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.