rsms / peertalk

iOS and Mac Cocoa library for communicating over USB
https://rsms.me/peertalk/
MIT License
3.43k stars 505 forks source link

issues with grafting to ios8 Failed to connect to device #22: Error Domain=PTUSBHubError Code=3 #70

Closed RainyLave closed 2 months ago

RainyLave commented 4 months ago

Peertalk is a very fantastic project! As there's still many old devices such as ipad2 and iphone4s. To make extremely good use of these old devices I decide to graft this project on ios8, which is completely jailbroken. The building device I use is macos12.2 with xcode10.0, and the target device includes an iphone4s with iOS9.3.6 and an ipad2.1 with ios8.4.1. The building process is extremely smooth without removing or changing any codes in the project, and I get success in building and transferring the project on both iphone4s and ipad2. Unfortunately, the app can't work correctly on my devices. When I turn on the debug modes, it shows like below: 截屏2024-05-22 20 35 39

it seems that iOS and macOS can't communicate well, but I can't find the problem where it locates in.

can anybody help me?

RainyLave commented 4 months ago

I try to use higher Xcode edition, and iOS example doesn't throw out the error, but when I connect the iPhone maxos example hints me that: 2024-05-23 23:58:12.977535+0800 Peertalk macOS Example[43856:311851] Failed to connect to device #22: Error Domain=PTUSBHubError Code=3 "connection refused" UserInfo={NSLocalizedDescription=connection refused} 截屏2024-05-23 23 59 14

RainyLave commented 4 months ago

So far, with changing some configures, I have transplanted this project on ios9. Some important settings are: set the storyboards' setting targets above iOS10.0(to avoid errors while building the uikit), by this way, the project can work smoothly on ios9. Also, as UIStackView doesn't support iOS8, I've changed all UIStackView to UIView, and this can also run smoothly on iOS9, however, when I install the app on my iOS8 iPad, it crashes. When I check the system logs on iOS8 iPad, it shows: EXC_CRASH (SIGABRT). I haven't determined wether it is caused by abort functions or it's parent process. Also, when I install the app on iOS8, it hints me that, xcode can't locate Peertalk.app, however, when I run it on iOS9, all things are looking correct! Can anyone help me to locate the reason why it can't run on iOS8? Later I would upload my ipa for testing

RainyLave commented 2 months ago

Using FDStackView instead of UIStackView can solve!