【问题标题】:How to fix iOS Simulator [native-run] ERR_DEVICE_LOCKED: Device still locked after 1 minute on the Apple Silicon (M1)?如何修复 iOS 模拟器 [native-run] ERR_DEVICE_LOCKED:在 Apple Silicon (M1) 上 1 分钟后设备仍被锁定?
【发布时间】:2021-04-23 00:08:42
【问题描述】:

无论--target 变量如何,以下命令都会失败:

ionic cordova run ios --target="iPhone-X"

ionic cordova run ios --target="iPhone 12"

ionic cordova emulate ios --debug --target="iPhone 11" -- --buildFlag="-UseModernBuildSystem=0"

错误是:

[native-run] ERR_DEVICE_LOCKED: Device still locked after 1 minute. Aborting.
[ERROR] An error occurred while running subprocess native-run.

这是在我切换到 Apple Silicon (M1) MacBook Pro 后发生的,但我不能 100% 确定。谢谢!

【问题讨论】:

  • 1) 如果您只是尝试ionic cordova run ios 会发生什么 2) 您能否让模拟器自行启动?
  • @E.Maggini 1) 它启动 iPod touch... 2) 是的,默认情况下启动模拟器启动 iPhone 12 Pro Max

标签: cordova ionic-framework ios-simulator ionic5 apple-silicon


【解决方案1】:

我今天遇到了同样的问题,结果证明它使用“Target ID”而不是“Target Name”。

  1. 使用--list 选项检查可用目标列表
ionic cordova run ios --list
  1. 使用 TARGET ID 运行相同的命令。
ionic cordova run ios --target="...TARGET-ID-1A2B3B..."

顺便提一下,我使用的是基于 INTEL 的 MacBook Pro。

【讨论】:

【解决方案2】:

在这里,我执行了:

native-run ios --virtual --list

接下来,

cordova build ios --debug --emulator && native-run ios --app platforms/ios/build/emulator/MyApp.app --virtual --forward 8100:8100 --target <TARGET ID>

其他选择:

native-run ios --app platforms/ios/build/emulator/MyApp.app --virtual --forward 8100:8100 --target <TARGET_ID>

【讨论】:

    【解决方案3】:

    对我来说,这条消息是在不同的情况下发生的。该设备尚未注册到 Apple 帐户!

    所以我用 XCode 启动了一次,它自动注册了设备(对我来说),然后它就可以工作了。

    【讨论】:

    • 未注册的设备也是我的问题。谢谢! :-)
    【解决方案4】:

    这对我有用!

    使用 --list 选项检查可用目标列表

    ionic cordova run ios --list
    

    使用 TARGET ID 运行相同的运行命令。

    ionic cordova run ios --target="XXXXXXXXXXXXXXX"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-18
      • 2022-11-11
      • 2021-03-02
      • 2021-04-05
      • 2021-04-21
      相关资源
      最近更新 更多