Xamarin应用程序示例在iPhone模拟器上崩溃 [英] Sample Xamarin App Crashes on iPhone Simulator

查看:80
本文介绍了Xamarin应用程序示例在iPhone模拟器上崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题.我下载了示例项目. 我主要在Windows 10上进行开发,但是对于iOS部分,我是从macinthecloud.com购买了虚拟机

I have the following issue. I downloaded this sample project. I develop primarily on Windows 10 however for the iOS part I purchased a VM from macinthecloud.com

我有一台真正的iPhone设备,但是由于我们使用VM,因此无法连接它,或者它过于复杂/昂贵.我的目标是创建ipa/zip文件,以后可以通过Appium将其用于UI测试.我购买了Apple Developer Account,并能够创建一个ipa文件.

I have a real iPhone device however since we use VM I cannot connect it, or it is too complicated/expensive. My goal was to create ipa/zip file which I can later use for UI tests through Appium. I purchased Apple Developer Account and was able to create an ipa file.

它已安装在模拟器上,但是,如果您尝试运行它,它将立即崩溃.我阅读了我能找到的所有内容,有些人认为构建体系结构可能是错误的.此MacOS VM唯一可用的选项是ARM64. 从模拟器调试日志中显示以下错误:

It is installed on the simulator however if you try to run it, it immediately crashes. I read everything I could find, some people suggest that probably the build architecture is wrong. The only available option from this MacOS VM is ARM64. The following error was displayed from the simulator debug log:

Nov 10 10:13:06 DXU684 com.apple.CoreSimulator.SimDevice.AEDE77F9-AFD7-4788-9F69-9FB6FA9CDF54[63635] (com.apple.videosubscriptionsd[64306]): Service exited with abnormal code: 1
Nov 10 10:13:08 DXU684 com.apple.CoreSimulator.SimDevice.AEDE77F9-AFD7-4788-9F69-9FB6FA9CDF54[63635] (UIKitApplication:com.xamarin.standardcontrols[0x2a65][63661][64308]): Program specified by service does not contain any valid architectures for this system.

能否请您提出我该如何处理此问题?我需要在通过Appium安装的模拟器上运行Xamarin应用(进展顺利,猜测是构建设置的主要问题)

Can you please suggest how I can handle the problem? I need to run the Xamarin app on the Simulator installed through Appium (which is going well, guess is the primary problem of the build settings)

推荐答案

服务指定的程序不包含此系统的任何有效体系结构.

Program specified by service does not contain any valid architectures for this system.

在IPA构建中,没有x86_64选项,因为没有基于x86的iOS设备,只有基于ARM的设备.

In a IPA build, there is no x86_64 option as there are no x86-based iOS devices, only ARM-based.

您可以做的是为Simulator/x86_64构建,然后将生成的.app拖放到模拟器中(或通过xcrun simctl install...安装,这是每个人(Appium,Xamarin等)用来控制模拟器).

What you could do is build for simulator/x86_64 and drag/drop the resulting .app to the simulator (or install via xcrun simctl install..., which is what everyone uses (Appium, Xamarin, ...) for controlling the simulator).

.appbin/iPhoneSimulator目录中生成,如下例:

The .app is generated in the bin/iPhoneSimulator directory, example below:

├── bin
│   └── iPhoneSimulator
│       └── Debug
│           ├── device-builds
│           │   ├── iphone11.4-12.0
│           │   │   ├── ios_XXXX.app
│           │   └── iphone11.4-12.1
│           │       ├── ios_XXXX.app

注意:通过Xcode 10.1/iOS 12.1/Xamarin.iOS 12.2.?.?通过拖放安装时将产生.app并产生.plist错误,但通过simctl安装时不会产生错误.在较早的Xamarin.iOS 12.x版本上不会发生这种情况,并且假设"它是Xamarin的错误,因为与Xcode构建相比,plist的格式略有错误(simctl似乎并不在乎,但模拟器GUI确实如此. ..)

Note: Building via Xcode 10.1 / iOS 12.1 / Xamarin.iOS 12.2.?.? will produce an .app that produces an .plist error when installed via drag/drop, but not when installed via simctl. This does not occur on earlier Xamarin.iOS 12.x versions and "assume" it is a Xamarin bug as the plist is slightly malformed when compared to an Xcode build (simctl does not seem to care, but the simulator GUI does...)

这篇关于Xamarin应用程序示例在iPhone模拟器上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆