鳍状肢:桌面未能提供证书。来自鳍状肢桌面的错误

在我尝试从 xcode 运行 ios 应用程序时获取鳍状肢错误日志。

flipper: Desktop failed to provide certificates. Error from flipper desktop:
rsocket::StreamInterruptedException: connection error

应用程序运行顺利,没有发现任何问题。但是此日志每 1 秒出现一次。

有没有办法解决这个问题?

stack overflow flipper: Desktop failed to provide certificates. Error from flipper desktop
原文答案

答案:

作者头像

我有同样的问题,我终于找到了解决这个问题的方法。我假设您在尝试使用真实的 iOS 设备调试您的应用程序时遇到此错误。这些是我采取的步骤。

  1. 您需要在后台运行 Flipper Desktop。它有一个集成的 React-devtools 插件。从 fbflipper.com 下载。按照他们文档上的说明进行操作,这很简单,也很直接。
    2.此时你不会有同样的错误信息。 (它会说证书没问题。)但是,如果你遇到任何关于 idb 二进制位置的问题(我在我的 M1 机器上做过),这条新消息会每秒弹出一次,Flipper 界面会告诉你设备不是成立。只要确保找到正确的 idb 二进制位置并配置它,重新启动 Flipper,这将一劳永逸地解决。我的在“/opt/homebrew/bin/idb”中。
作者头像

打开 Flipper > 设置 > 启用物理 iOS 设备

作者头像

只是将所有内容组合在一起,因为我在这个问题上遇到了困难......

  1. 打开脚蹼。在左下角,点击齿轮图标,然后点击设置
    2.一定要启用“启用物理iOS设备”选项。
  2. “IDB 二进制位置”上,您可能会看到一个警告标志(⚠️)。如果是这种情况,则意味着您没有 idb 客户端或者它的位置不正确。
  3. 按照 ALL these steps 安装 idb 伴侣和 idb 客户端。
    5.如果你没有安装python: brew install python3 。然后尝试重复步骤 4。
  4. 如果一切顺利,您的 idbidb-companion 应该位于“/opt/homebrew/bin”。所以现在你可以回到 Flipper > Gear Icon > Settings,粘贴路径“/opt/homebrew/bin/idb”,右边的警告标志(⚠️)就会消失。
  5. 如果您仍然有警告标志,则表示您的 idb 文件不在正确的位置。 this git post 中有几个替代方案可以解决此问题,因此请查看它们。
作者头像

TL: DR;

idb_companion was built for newer Swift enviroments, but I was still using Big Sur. After upgrading my MacOS, Flipper managed to connect to my iOS device fine.

Of course I explain below that I build idb from the source to match the version 1.1.8 for both idb_companion and idb.

Below I also explain how I found the error that was crashing idb_companion preventing Flipper from maintaining a stable connection and restarting several times yielding the message: [conn] ... restarted 4 times in 20 seconds.


What I learned:

  • idb_companion runs on my Mac in the background as a server that knows how to control or get logs from iOS physical devices;
  • idb is a command line interface that Flipper can use for communicating with idb_companion.

I was able to install idb_companion@1.1.8 using Homebrew. But I was not able to install the same version 1.1.8 for the cli (aka idb (aka fb-idb)).

So I decided to build the idb from the github repo. The command line for building it was

pip3.9 install .

First I struggled with an error related to grpclib version. Apparently idb required the version 0.4.1 but I had 0.4.3 installed. To downgrade grpclib I used the following command:

pip3.9 install grpclib==0.4.1

I also tried to make sure there was no other grpclib installed in other python version, so I ran a bunch of

pip3 install grpclib==0.4.1
pip3.7 install grpclib==0.4.1
pip3.9 install grpclib==0.4.1

To see which version of python I had, I ran a bunch of

which pip
which pip3
which pip3.6
which pip3.7
which pip3.8
which pip3.9
which pip3.10

Anyways... As I was randomly trying to build idb with those different python versions, with and without sudo, I also faced the following error, which was fixed just by adding sudo again to the build command.

ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/Users/alexandrelage/Library/Python/3.9/lib'
Check the permissions.

Anyways...

Basically after fixing the grpclib requirement, pip3.9 install . inside the source folder was enough for building idb (client, on version 1.1.8).

Of course I had to go to Flipper >> Settings and update the idb path. All seemed good.

Unfortunately that was not enough, Flipper kept on trying to connect to my iPhone device with no success. Then I copied the idb command Flipper was trying to run:

/Library/Frameworks/Python.framework/Versions/3.7/bin/idb file pull --log DEBUG --udid 00008020-000A7D2C36DUMMYDUMMY --bundle-id org.reactjs.native.example.MyExample 'Library/Application Support/sonar/app.csr' '/var/folders/r6/xrp3nw8j4wj45mvdpnlzlv740000gn/T/tmp-10199-CW6olKXUvwek/app.csr'

I was lucky to run the command above while I was also running idb_companion on another tab. The command I used to manually start idb_companion was:

idb_companion --uidid 00008020-000A7D2C36DUMMYDUMMY

I was lucky because I noticed the idb_companion tab stopped running when I tried to run the idb (client) command above I copied from Flipper. I restarted idb_companion again and tried to run the idb (client) command again. Then I realized idb_companion was crashing with an error message:

...
2022-10-21 18:14:11.853-0300 Starting swift server on tcp port 10882
2022-10-21 18:14:11.854-0300 Swift server started on [IPv6]::/:::10882
{"grpc_swift_port":10882,"grpc_port":10882}
2022-10-21 18:14:11.854-0300 Companion will stay alive if target goes offline
2022-10-21 18:14:30.997-0300 Start of connect
dyld: lazy symbol binding failed: 
can't resolve symbol _$sScCMa in 
/usr/local/Cellar/idb-companion/1.1.8/bin/../Frameworks/IDBGRPCSwift.framework/Versions/A/IDBGRPCSwift 
because dependent dylib @rpath/libswift_Concurrency.dylib could not be loaded
dyld: can't resolve symbol _$sScCMa in 
/usr/local/Cellar/idb-companion/1.1.8/bin/../Frameworks/IDBGRPCSwift.framework/Versions/A/IDBGRPCSwift 
because dependent dylib @rpath/libswift_Concurrency.dylib could not be loaded

That indicated there was something else going on. It seemed idb_companion was built for a Swift environment different to mine. I looked for this error on Google and realized my XCode was outdated. In fact I was still using Big Sur.

Now I upgraded my MacOS to Montrey, Flipper manages to connect to my iOS device fine. And I haven't even upgraded my XCode yet.

相关问题