wsvn53 / scrcpy-mobile

Ported scrcpy for mobile platforms, to remotely control Android devices on your iPhone or Android phone.
MIT License
558 stars 33 forks source link

Scrcpy Remote version 2.0 crashes when I try to open it on iOS 14 Taurine #53

Closed plia7 closed 6 months ago

plia7 commented 7 months ago

Hello,

I have iPhone 12 Pro Max on iOS 14.4.1 with Taurine jailbreak.

Steps to reproduce: I downloaded scrcpy-ios.ipa version 2.0 from Github releases and sideloaded/installed it through TrollStore app. When I try to open it, it crashes.

Expected behavior: Being able to open the app, just like how Scrcpy Remote version 1.6 opens for me.

Actual behavior: App crashes.

Workaround: I'm able to run it when I reboot my phone without the jailbreak, but it won't connect to the adb host, it fails connecting although initially it says "adb connecting" and "adb connected" but it doesn't actually show the adb host screen and this error shows in scrcpy remote logs: https://justpaste.it/8ll89

Crash Logs:

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000 VM Region Info: 0 is not in any region. Bytes before following region: 4295622656 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START --->
__TEXT 1000a0000-101404000 [ 19.4M] r-x/r-x SM=COW ...pp/scrcpy-ios

Triggered by Thread: 0

Additional Context: If I download scrcpy-ios.ipa version 1.6 from Github releases and sideload/install it through TrollStore app, it works fine but I want to be able to use the newest 2.0 version that includes sound support.

Thank you.

plia7 commented 7 months ago

@dixtdf @mhh996378373 You say it only crashes when the jailbreak is on? If you turn it off, then it works fine?

@wsvn53 I'm able to run it when I reboot my phone without the jailbreak, but it won't connect to the adb host, it fails connecting with the following error in scrcpy logs (it says adb connecting, adb connected but it doesn't actually show the adb host screen):

https://justpaste.it/

plia7 commented 7 months ago

@wsvn53 @dixtdf @mhh996378373 I tried to give it entitlements permissions after installing it through NewTerm shell:

ldid -P -K/taurine/signcert.p12 -S/var/mobile/Documents/entitlements/global.xml -M /var/containers/Bundle/Application/14407FBF-5F1B-4B04-9D57-D905D6D9E098/scrcpy-ios.app/scrcpy-ios

But it still crashes.

Any other suggestions?

Thank you.

dixtdf commented 7 months ago

My configuration is iPhone 11+14.3+unc0ver+TrollStore. Currently, everything is normal and I have not used Taurine

plia7 commented 7 months ago

My configuration is iPhone 11+14.3+unc0ver+TrollStore. Currently, everything is normal and I have not used Taurine

@dixtdf So you say it doesn't crash for you on iOS 14.3 with unc0ver jailbreak? Hmmm, ok... I recently upgraded to Taurine jailbreak because it's less buggy more smooth and faster performance wise and less battery drain too. So it's great upgrade from unc0ver but I guess I need to figure out how to be able to run scrcpy version 2.0 on it as there seems to be some permissions/entitlements issue going on possibly between with Taurine jailbreak and this app that's causing the app to crash.

plia7 commented 6 months ago

@wsvn53 I just added the crash log:

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000 VM Region Info: 0 is not in any region. Bytes before following region: 4295622656 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START --->
__TEXT 1000a0000-101404000 [ 19.4M] r-x/r-x SM=COW ...pp/scrcpy-ios

Triggered by Thread: 0

This article from Apple explains how to backtrack this error back to the line of code that's failing:

https://developer.apple.com/documentation/xcode/investigating-memory-access-crashes#Identify-the-type-of-memory-access-that-caused-the-issue

**Overview A crash due to a memory access issue occurs when an app uses memory in an unexpected way. Memory access problems have numerous causes, such as dereferencing a pointer to an invalid memory address, writing to read-only memory, or jumping to an instruction at an invalid address. These crashes are most often identified by the EXC_BAD_ACCESS (SIGSEGV) or EXC_BAD_ACCESS (SIGBUS) exceptions in the crash report: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS

KERN_INVALID_ADDRESS. The crashed thread accessed unmapped memory, either by accessing data or an instruction fetch. Identify the type of memory access that caused the issue describes how to tell the difference.

They provide an example there and how to use the atos command line tool with the dSYM file for the binary, and identify the corresponding code that's failing. **

Could you please fix it?

Thank you.

wsvn53 commented 6 months ago

Hi, can you help try the latest 2.3 version of scrcpy-ios?

Download this ipa scrcpy-ios.ipa.zip

Or via testflight: https://testflight.apple.com/join/9ZE6xhRt

wsvn53 commented 6 months ago

@wsvn53 I just added the crash log:

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000 VM Region Info: 0 is not in any region. Bytes before following region: 4295622656 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> __TEXT 1000a0000-101404000 [ 19.4M] r-x/r-x SM=COW ...pp/scrcpy-ios

Triggered by Thread: 0

This article from Apple explains how to backtrack this error back to the line of code that's failing:

https://developer.apple.com/documentation/xcode/investigating-memory-access-crashes#Identify-the-type-of-memory-access-that-caused-the-issue

**Overview A crash due to a memory access issue occurs when an app uses memory in an unexpected way. Memory access problems have numerous causes, such as dereferencing a pointer to an invalid memory address, writing to read-only memory, or jumping to an instruction at an invalid address. These crashes are most often identified by the EXC_BAD_ACCESS (SIGSEGV) or EXC_BAD_ACCESS (SIGBUS) exceptions in the crash report: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS

KERN_INVALID_ADDRESS. The crashed thread accessed unmapped memory, either by accessing data or an instruction fetch. Identify the type of memory access that caused the issue describes how to tell the difference.

They provide an example there and how to use the atos command line tool with the dSYM file for the binary, and identify the corresponding code that's failing. **

Could you please fix it?

Thank you.

It seems caused by Xcode SDK version, can you try the latest version ipa? And let me know if the issue still exists.

plia7 commented 6 months ago

@wsvn53 I just added the crash log:

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000 VM Region Info: 0 is not in any region. Bytes before following region: 4295622656 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> __TEXT 1000a0000-101404000 [ 19.4M] r-x/r-x SM=COW ...pp/scrcpy-ios

Triggered by Thread: 0

This article from Apple explains how to backtrack this error back to the line of code that's failing:

https://developer.apple.com/documentation/xcode/investigating-memory-access-crashes#Identify-the-type-of-memory-access-that-caused-the-issue

**Overview A crash due to a memory access issue occurs when an app uses memory in an unexpected way. Memory access problems have numerous causes, such as dereferencing a pointer to an invalid memory address, writing to read-only memory, or jumping to an instruction at an invalid address. These crashes are most often identified by the EXC_BAD_ACCESS (SIGSEGV) or EXC_BAD_ACCESS (SIGBUS) exceptions in the crash report: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS

KERN_INVALID_ADDRESS. The crashed thread accessed unmapped memory, either by accessing data or an instruction fetch. Identify the type of memory access that caused the issue describes how to tell the difference.

They provide an example there and how to use the atos command line tool with the dSYM file for the binary, and identify the corresponding code that's failing. **

Could you please fix it?

Thank you.

It seems caused by Xcode SDK version, can you try the latest version ipa? And let me know if the issue still exists.

Ok let me try the 2.3 ipa.

Thank you.

wsvn53 commented 6 months ago

@wsvn53 I just added the crash log:

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000 VM Region Info: 0 is not in any region. Bytes before following region: 4295622656 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> __TEXT 1000a0000-101404000 [ 19.4M] r-x/r-x SM=COW ...pp/scrcpy-ios

Triggered by Thread: 0

This article from Apple explains how to backtrack this error back to the line of code that's failing:

https://developer.apple.com/documentation/xcode/investigating-memory-access-crashes#Identify-the-type-of-memory-access-that-caused-the-issue

**Overview A crash due to a memory access issue occurs when an app uses memory in an unexpected way. Memory access problems have numerous causes, such as dereferencing a pointer to an invalid memory address, writing to read-only memory, or jumping to an instruction at an invalid address. These crashes are most often identified by the EXC_BAD_ACCESS (SIGSEGV) or EXC_BAD_ACCESS (SIGBUS) exceptions in the crash report: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS

KERN_INVALID_ADDRESS. The crashed thread accessed unmapped memory, either by accessing data or an instruction fetch. Identify the type of memory access that caused the issue describes how to tell the difference.

They provide an example there and how to use the atos command line tool with the dSYM file for the binary, and identify the corresponding code that's failing. **

Could you please fix it?

Thank you.

It seems caused by Xcode SDK version, can you try the latest version ipa? And let me know if the issue still exists.

This is the latest version ipa showing: https://github.com/wsvn53/scrcpy-mobile/releases/download/v2.0/scrcpy-ios.ipa

Could you please send me a link or email me the newer one? I don't have this issue with 1.6 ipa, did you use different xcode sdk for 2.0? maybe you could republish the 2.0 ipa with same xcode sdk that you used for 1.6 ipa?

Thank you.

Please refer to this post: https://github.com/wsvn53/scrcpy-mobile/issues/53#issuecomment-1953826160, the newest version is v2.3

plia7 commented 6 months ago

Hi, can you help try the latest 2.3 version of scrcpy-ios?

Download this ipa scrcpy-ios.ipa.zip

Or via testflight: https://testflight.apple.com/join/9ZE6xhRt

Is it a zip file? when I try to unzip it with filza it says: "Could not decompress this file"

Do you have it decompressed just the ipa file by itself (like the other links)?

Thanks.

wsvn53 commented 6 months ago

Hi, can you help try the latest 2.3 version of scrcpy-ios? Download this ipa scrcpy-ios.ipa.zip Or via testflight: https://testflight.apple.com/join/9ZE6xhRt

Is it a zip file? when I try to unzip it with filza it says: "Could not decompress this file"

Do you have it decompressed just the ipa file by itself (like the other links)?

Thanks.

That becasue github don't support upload ipa file, here I upload another zip with compression, you just need to rename this file by removing the .zip extension after downloaded: scrcpy-ios.ipa.zip

plia7 commented 6 months ago

Hi, can you help try the latest 2.3 version of scrcpy-ios?

Download this ipa scrcpy-ios.ipa.zip

Or via testflight: https://testflight.apple.com/join/9ZE6xhRt

Is it a zip file? when I try to unzip it with filza it says: "Could not decompress this file"

Do you have it decompressed just the ipa file by itself (like the other links)?

Thanks.

That becasue github don't support upload ipa file, here I upload another zip with compression, you just need to rename this file by removing the .zip extension after downloaded:

scrcpy-ios.ipa.zip

Ok that one works. Can I also try the 2.1 ipa to see if there is any difference between them when testing? Since the 2.1 is a stable release and 2.3 is still in testing so less stable.

2.3 sometimes says adb connected but don't show the screen:

DEBUG: Server connected DEBUG: Starting controller thread DEBUG: Starting receiver thread INFO: Renderer: metal DEBUG: Trilinear filtering disabled (not an OpenGL renderer DEBUG: Demuxer 'video': starting thread DEBUG: Receiver stopped DEBUG: quit... ERROR: Demuxer 'video': stream disabled due to connection error ERROR: Demuxer error 2024-02-20 02:56:05.173 scrcpy-ios[22231:737530] Show More Menu 2024-02-20 02:56:11.957 scrcpy-ios[22231:737530] LogPath: /var/mobile/Containers/Data/Application/D82303C2-AA31-4733-8DA0-740F32B2F6B7/Documents/scrcpy@2024-02.log, Size: 1041034

Is it considered a bug? Like every 5-6 tries it will say connected but won't actually show the screen. Or I have a shortcuts trigger to reconnect when app opens, but sometimes when I open it, nothing happens, sometimes it just shows the app splash screen logo for a long time but my shortcuts trigger won't fire. Don't recall this happening with 1.6. Could you please share 2.1 ipa so I could compare?

Thank you.

wsvn53 commented 6 months ago

Hi, can you help try the latest 2.3 version of scrcpy-ios?

Download this ipa scrcpy-ios.ipa.zip

Or via testflight: https://testflight.apple.com/join/9ZE6xhRt

Is it a zip file? when I try to unzip it with filza it says: "Could not decompress this file"

Do you have it decompressed just the ipa file by itself (like the other links)?

Thanks.

That becasue github don't support upload ipa file, here I upload another zip with compression, you just need to rename this file by removing the .zip extension after downloaded: scrcpy-ios.ipa.zip

Ok that one works. Can I also try the 2.1 ipa to see if there is any difference between them when testing? Since the 2.1 is a stable release and 2.3 is still in testing so less stable.

2.3 sometimes says adb connected but don't show the screen:

DEBUG: Server connected DEBUG: Starting controller thread DEBUG: Starting receiver thread INFO: Renderer: metal DEBUG: Trilinear filtering disabled (not an OpenGL renderer DEBUG: Demuxer 'video': starting thread DEBUG: Receiver stopped DEBUG: quit... ERROR: Demuxer 'video': stream disabled due to connection error ERROR: Demuxer error 2024-02-20 02:56:05.173 scrcpy-ios[22231:737530] Show More Menu 2024-02-20 02:56:11.957 scrcpy-ios[22231:737530] LogPath: /var/mobile/Containers/Data/Application/D82303C2-AA31-4733-8DA0-740F32B2F6B7/Documents/scrcpy@2024-02.log, Size: 1041034

Is it considered a bug? Like every 5-6 tries it will say connected but won't actually show the screen. Or I have a shortcuts trigger to reconnect when app opens, but sometimes when I open it, nothing happens, sometimes it just shows the app splash screen logo for a long time but my shortcuts trigger won't fire. Don't recall this happening with 1.6. Could you please share 2.1 ipa so I could compare?

Thank you.

Please provide detail phone model infromation, this issue seems caused by opengl render, which maybe your device not support. And can you try use desktop version of scrcpy to connect and paste the detail log here if video is correct.

plia7 commented 6 months ago

Hi, can you help try the latest 2.3 version of scrcpy-ios?

Download this ipa scrcpy-ios.ipa.zip

Or via testflight: https://testflight.apple.com/join/9ZE6xhRt

Is it a zip file? when I try to unzip it with filza it says: "Could not decompress this file"

Do you have it decompressed just the ipa file by itself (like the other links)?

Thanks.

That becasue github don't support upload ipa file, here I upload another zip with compression, you just need to rename this file by removing the .zip extension after downloaded:

scrcpy-ios.ipa.zip

Ok that one works. Can I also try the 2.1 ipa to see if there is any difference between them when testing? Since the 2.1 is a stable release and 2.3 is still in testing so less stable.

2.3 sometimes says adb connected but don't show the screen:

DEBUG: Server connected DEBUG: Starting controller thread DEBUG: Starting receiver thread INFO: Renderer: metal DEBUG: Trilinear filtering disabled (not an OpenGL renderer DEBUG: Demuxer 'video': starting thread DEBUG: Receiver stopped DEBUG: quit... ERROR: Demuxer 'video': stream disabled due to connection error ERROR: Demuxer error 2024-02-20 02:56:05.173 scrcpy-ios[22231:737530] Show More Menu 2024-02-20 02:56:11.957 scrcpy-ios[22231:737530] LogPath: /var/mobile/Containers/Data/Application/D82303C2-AA31-4733-8DA0-740F32B2F6B7/Documents/scrcpy@2024-02.log, Size: 1041034

Is it considered a bug? Like every 5-6 tries it will say connected but won't actually show the screen. Or I have a shortcuts trigger to reconnect when app opens, but sometimes when I open it, nothing happens, sometimes it just shows the app splash screen logo for a long time but my shortcuts trigger won't fire. Don't recall this happening with 1.6. Could you please share 2.1 ipa so I could compare?

Thank you.

Please provide detail phone model infromation, this issue seems caused by opengl render, which maybe your device not support. And can you try use desktop version of scrcpy to connect and paste the detail log here if video is correct.

It's Moto G Pure 2021 Android 11. What scrcpy desktop version should I use to test? Also any chance you could please share the v2.1 ipa to see if it works better? As well as any chance you could add this new parameter please to iOS URL scheme of the app:

https://github.com/wsvn53/scrcpy-mobile/issues/54

Thank you.

mhh996378373 commented 6 months ago

@dixtdf @mhh996378373 You say it only crashes when the jailbreak is on? If you turn it off, then it works fine?

@wsvn53 I'm able to run it when I reboot my phone without the jailbreak, but it won't connect to the adb host, it fails connecting with the following error in scrcpy logs (it says adb connecting, adb connected but it doesn't actually show the adb host screen):

https://justpaste.it/

When ios14.6 is jailbroken using Taurine, scrcpy2.0 or above will not be able to open, but it will be completely normal to use after exiting the jailbreak environment. In fact, many apps will have similar situations after Taurine jailbreak, and Taurine jailbreak will cause volte calls in China. Invalid, 5G network is invalid, wireless carplay is invalid, homekit is invalid, etc.

plia7 commented 6 months ago

@dixtdf @mhh996378373 You say it only crashes when the jailbreak is on? If you turn it off, then it works fine?

@wsvn53 I'm able to run it when I reboot my phone without the jailbreak, but it won't connect to the adb host, it fails connecting with the following error in scrcpy logs (it says adb connecting, adb connected but it doesn't actually show the adb host screen):

https://justpaste.it/

When ios14.6 is jailbroken using Taurine, scrcpy2.0 or above will not be able to open, but it will be completely normal to use after exiting the jailbreak environment. In fact, many apps will have similar situations after Taurine jailbreak, and Taurine jailbreak will cause volte calls in China. Invalid, 5G network is invalid, wireless carplay is invalid, homekit is invalid, etc.

Actually no, I already got scrcpy v2.3 working. 2.0 just had some xda sdk issue per the developer.

dixtdf commented 6 months ago

Hi, can you help try the latest 2.3 version of scrcpy-ios?

Download this ipa scrcpy-ios.ipa.zip

Or via testflight: https://testflight.apple.com/join/9ZE6xhRt

这个版本成功解决了ios16.1.2上无法查看页面的问题

plia7 commented 6 months ago

Closing ticket as version 2.3 works.