【问题标题】:How to launch a xamarin app on iOS simulator from windows?如何从 Windows 在 iOS 模拟器上启动 xamarin 应用程序?
【发布时间】:2021-09-13 15:07:49
【问题描述】:

我已经构建了一个 xamarin 应用程序并在 android 模拟器上对其进行了测试,并且该应用程序运行良好。我决定在 iOS 模拟器上测试它,但它并没有按计划进行。我已将我的 windows pc 连接到 MacBook Pro,将 Visual Studio 2019 和 xCode 更新到最新版本并设置了自动配置。当我尝试在不重要的 ios 14.5 版本的 iPhone 上启动应用程序时,我收到此错误:

error HE0046: Failed to install the app 'packageName' on the device 'iOS 14.5 (18E182) - iPhone 12': ???appName??? Needs To Be Updated  

我用谷歌搜索它没有成功。我尝试在较旧的 iOS 版本上启动该应用程序,但出现另一个错误:

error HE0042: Could not launch the app 'packageName' on the device 'iOS 13.0 (17A577) - iPhone 8': The request to open "appName" failed.

我已经检查了 MacBook 模拟器上的日志,但我仍然无法解决我的问题。

来自 iPhone 8 iOS 13.0 模拟器的日志:

Jul  1 16:02:11 Borjans-MBP com.apple.CoreSimulator.SimDevice.7E33AFBE-858C-4EBD-9470-8E503EAA0B21[18503] (UIKitApplication:packageName[82f8][rb-legacy][38282]): Could not find and/or execute program specified by service: 86: Bad CPU type in executable: /Users/borjan/Library/Developer/CoreSimulator/Devices/7E33AFBE-858C-4EBD-9470-8E503EAA0B21/data/Containers/Bundle/Application/B178901C-355F-4956-9EA0-296A2CEB1718/projectName.iOS.app/projectName.iOS
Jul  1 16:02:11 Borjans-MBP com.apple.CoreSimulator.SimDevice.7E33AFBE-858C-4EBD-9470-8E503EAA0B21[18503] (UIKitApplication:bundleName[82f8][rb-legacy][38282]): Service setup event to handle failure and will not launch until it fires.
Jul  1 16:02:11 Borjans-MBP com.apple.CoreSimulator.SimDevice.7E33AFBE-858C-4EBD-9470-8E503EAA0B21[18503] (UIKitApplication:bundleName[82f8][rb-legacy][38282]): Service exited with abnormal code: 78
Jul  1 16:02:59 Borjans-MBP syslogd[18505]: ASL Sender Statistics

我花了几天时间寻找解决方案,但没有找到。有人可以帮帮我吗?

【问题讨论】:

  • 你想在windows或macBook上看app的UI吗?
  • 我尝试在 Windows 上显示模拟器,但出现错误:找不到设备“GUID”。然后我取消选中“远程模拟器到 Windows”。我已经得到了问题中已经提供的错误。
  • 我还创建了新的 xamarin 项目来测试它,它是在 MacBook 上的 iPhone 模拟器上启动的。我还比较了两个项目的配置,它们是相同的......仍然可以找到应用程序无法启动的原因。
  • I’ve tried displaying the emulator on windows, I’ve got an error: the device “GUID” is not found. 是的,这是一个已知问题,您可以在这里查看:developercommunity.visualstudio.com/t/…

标签: ios macos xamarin


【解决方案1】:

我终于找到了问题所在。当我单击运行按钮时,配置会以某种方式从 iPhoneSimulator 更改为 iPhone。我应该手动将配置设置为 iPhoneSimulator,它现在可以工作了。只需进入配置管理器,找到 iOS 项目并将平台设置为 iPhoneSimulator 而不是 iPhone。

【讨论】:

    猜你喜欢
    • 2015-06-23
    • 1970-01-01
    • 2013-11-22
    • 1970-01-01
    • 1970-01-01
    • 2012-04-14
    • 2015-10-14
    • 2017-03-13
    • 1970-01-01
    相关资源
    最近更新 更多