美文网首页
Xcode 真机运行报错

Xcode 真机运行报错

作者: 我叫没名字啊 | 来源:发表于2024-09-26 19:12 被阅读0次

Q:

最近手机升级了 iOS18.0,Xcode 也升级到了 16.0,相当于真机和 Xcode 都升级到了最新版本,但是却报错无法识别设备。

Waiting to reconnect to Caxue

Previous preparation error: The developer disk image could not be mounted on this device.; The caller does not have permission to perform the specified operation.

A1:

其实这个报错一般常见于,手机系统版本太高🔼,Xcode 版本太低🔽的情况下,会无法识别设备。所以优先建议大家先排查版本的对应,升级下 Xcode 试试。

如果还不行,先试下以下方法,排除 iOS 系统的一些抽风问题:

  1. 重启下电脑和手机试试;
  2. 在手机设置里,找到开发者选择,点击 “清除受信任电脑”,然后重新连电脑试试;


    图1.jpg

A2:

如果上述方法都不行,那就试试下面这个:

😈🧙 因为我 Xcode 已经升到最新版,并且重启等方式都不行,所以搞点野路子试试。参考帖子
  1. 在命令行中,退到系统根目录,也就是 cd //,然后到 open /library/Developer/DeveloperDiskImages,把 DeveloperDiskImages 文件夹里面的文件都删掉(先挪出来,别彻底删除)。
    图2.png
  1. 然后连真机尝试运行,这时候会提示
Previous preparation error: Failed to find a DDI that can be used to enable DDI services on the device. Usually this means the best DDI we could find for a platform did not have compatible CoreDevice content. Run 'devicectl list preferredDDI' from the command line to get more details on why no valid DDI can be found.
图3.png
  1. 接下来再把刚才删除的文件,再重新放回 DeveloperDiskImages 文件夹下,重启下 Xcode,此时再去 Manage Run Destinations 里看看,就会提示链接中了,等进度条读完,就可以真机调试了。
    图4.png
    图5.png

相关文章

网友评论

      本文标题:Xcode 真机运行报错

      本文链接:https://www.haomeiwen.com/subject/alzhrjtx.html