altstoreio / AltStore

AltStore is an alternative app store for non-jailbroken iOS devices.
https://altstore.io
GNU Affero General Public License v3.0
11.68k stars 886 forks source link

AltJIT timeouts too early while attempting to connect to device, resulting in python3 timed out. AltServer.ProcessError 0 #1336

Open RedstoneGithub opened 10 months ago

RedstoneGithub commented 10 months ago

For performing JIT on macOS sonoma 14.0 (M1 Pro) and iOS 17.1.1 (iPhone 14 Pro), it would take ~32 seconds and ~20 seconds to connect to pymobiledevice3 and start the debugger, using the terminal (./python3 -m pymobiledevice3 remote start-quic-tunnel and ./python3 -m pymobiledevice3 developer debugserver start-server respectively) but AltStore times out at 20 and 10 seconds respectively, resulting in an error while trying to enable JIT: The process python3 timed out.

Screenshot 2023-11-13 at 7 40 03 PM

After downloading the repo and, in the EnableJIT swift file, increasing the rsdTunnel timeout to 40 80 seconds and the debugserver timeout to 40 80 seconds, it works perfectly fine. The exact time may need to be changed, but 20 and 10 seconds was definitely too short for my device.

func startRSDTunnel() async throws -> RemoteServiceDiscoveryTunnel
    {
        do
        {
            Logger.main.info("Starting RSD tunnel...")

            let process = try Process.launch(.python3, arguments: ["-u", "-m", "pymobiledevice3", "remote", "start-quic-tunnel", "--udid", self.udid], environment: self.processEnvironment)

            do
            {
                let rsdTunnel = try await withTimeout(seconds: 80) {
                    let regex = Regex {
                        "--rsd"
func startDebugServer(rsdTunnel: RemoteServiceDiscoveryTunnel) async throws -> Int
    {
        do
        {
            Logger.main.info("Starting debugserver...")

            return try await withTimeout(seconds: 80) {

Edit: clarify which file I edited Edit 2: I have tried a few more times and this time it took around 60 seconds. The timeout should be increased to about 80.

clintebbesen commented 10 months ago

I'm having this same issue, looking forward to when a fix is released

Kimcheesee commented 10 months ago

I'm having the same issue, hoping the team will fix it soon

Kimcheesee commented 10 months ago

@RedstoneGithub after changing the timeout duration, what other steps did you take in order to workaround this issue for now?

Kuba799500 commented 10 months ago

@RedstoneGithub Is it possible to change it easily without compiling entire app?

Kowken commented 10 months ago

@RedstoneGithub Greetings. Sorry to bother you but would you mind sharing your build ? I have issues building my own and I have a free developper account. Thanks in advance and have a great day. Best regards.

Lambdacreator commented 10 months ago

@RedstoneGithub Hi, I would interested in the build as well would you mind sharing it?

shanegillio commented 10 months ago

If anyone here wants to test this, we'll be releasing an extended timeout version if everything works as it should AltServer.zip

Lambdacreator commented 10 months ago

@shanegillio Thanks for sharing now it works perfectly!

HDevApps commented 10 months ago

Still not working for me even after the switch to 80 seconds.

DigNeurosurgeon commented 9 months ago

same here... tried the zip file posted above but still getting the same issue (and indeed, performing the connection in terminal does work)

CrediblePigeon7 commented 5 months ago

When i pasted that code into terminal all it gave me is this: zsh: parse error near do' Can someone please tell me why this is?