Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreliable simulate-location with iOS 17 #572

Open
filmackay opened this issue Sep 24, 2023 · 19 comments
Open

Unreliable simulate-location with iOS 17 #572

filmackay opened this issue Sep 24, 2023 · 19 comments

Comments

@filmackay
Copy link

Is anyone else having set work fine, but clear not do anything?

@doronz88
Copy link
Owner

I just tested this again and this worked fine. Also, when closing the context-manager from the CLI it also reset my location to the original one.

@filmackay
Copy link
Author

filmackay commented Sep 24, 2023

OK that's weird. This is was entirely reproducible or me.

I can (sometimes) get it to work - but when I "clear" (oslogs look like the correct action is being taken at least) my location is very inaccurate for a substantial period of time. Do you see any of these symptoms as well?

@doronz88
Copy link
Owner

No, I haven't encountered them at least in my setup scenario. I also tried to write a small snippet that sets and then resets the location immediately and it also worked just as expected

@filmackay
Copy link
Author

OK - I just tried again (admittedly on head this time) and it works. I am using the USB-C cable that came with a iPhone 15 Pro - as opposed to another USB-C "charge cable" (still Apple, I think).

Is this a factor (charge cable v data cable?). Should I expect if I can see oslogs over the cable that everything should work; or is my different experiences explained with the different cables perhaps?

I also get some oslog errors being reported (stack trace) - should I put a PR up to resolve this, it crashes resonably frequently for me. Checking if there is some background here at all :)

@doronz88
Copy link
Owner

The cable isn't supposed to effect anything. If you discovered a bug and you know of a fix then please by any means submit a PR

@filmackay
Copy link
Author

filmackay commented Sep 27, 2023

I'll put up a PR for the oslog crash (crashes trying to parse out a formatted message), but I've managed to eliminate the cable (and other factors). Essentially, the set/clear cycle seems to work perfectly on occasion - but others (maybe 60% of the time) the set works but the clear does not (by clear I mean the 'reset' after the set completes).

I am on macOS, presuming you're testing on that as well..

I'll prepare a contrast of oslog for the fail/success case - anything else I should look at in particular? One other symptom I get: sometimes on sudo pymobiledevice3 remote start-quic-tunnel I get ERROR Device is not connected. This persists for a while (minutes) but then starts working again.. 🤷🏻

I see three cases on clearing the location (back to original):

  1. nothing happens (stays at simulated location, even though logs indicate it is not simulated any more)
  2. returns to non-simulated location, with precise location
  3. returns to non-simulated location, but very imprecise location (large circle of KM's) - and takes many minutes for the precision to return to normal.

@filmackay filmackay changed the title simulate-location clear with iOS 17 Unreliable simulate-location with iOS 17 Sep 27, 2023
@doronz88
Copy link
Owner

Yes, I'm testing on macOS also. Just making sure you know the oslog issue is completely unrelated, though I would appreciate any PRs to make this project better.

What macOS version are you using specifically? I know the monterey USB ethernet driver is somewhat unpredicatable.

Also, I'm not sure all the scenarios you are encountering aren't bugs on the device-end. Do you have other references you can compare it to? I'll be able to sniff the diff in the protocol messages.

@filmackay
Copy link
Author

Yes, I'm testing on macOS also. Just making sure you know the oslog issue is completely unrelated, though I would appreciate any PRs to make this project better.

Yes definitely unrelated - it's just a formatting issue where it fails the pattern match and there is no 'message' to communicate.

What macOS version are you using specifically? I know the monterey USB ethernet driver is somewhat unpredicatable.

I was on Monterey, just switched to Sonoma. I've only attempted once so far, and it did work - but the 'clear' returned my location to low-precision (suburb level) physical locale. But it did come good after while..

Also, I'm not sure all the scenarios you are encountering aren't bugs on the device-end. Do you have other references you can compare it to? I'll be able to sniff the diff in the protocol messages.

Other devices? It is a iPhone 15 Pro on my side, I could try something else..

@doronz88
Copy link
Owner

doronz88 commented Oct 1, 2023

I cannot find reasons why this happens, nor am I sure this is not Apple's own bug. If you can point at another scenario where the issue is fixed I can sniff it and compare.

@c00ni
Copy link

c00ni commented Oct 3, 2023

I presume you meant clear actually puts the phone in an unable to find current location mode (grey circle in google maps) centred around the simulated location.

iOS can have "trouble" finding your real location again if you've been simulating a location far away from your real location.
To speed it up significantly, set the location to somewhere close to your real location first and then reset.

This pre-dates iOS 17 (and many previous versions as well).

@Fidetro
Copy link
Contributor

Fidetro commented Oct 16, 2023

I found out that clear doesn't work properly in this case.

  1. sudo python3 -m pymobiledevice3 remote start-quic-tunnel
  2. pymobiledevice3 developer dvt simulate-location set --rsd host port -- 60 60
  3. Disconnect iPhone by unplugging the cable;
  4. sudo python3 -m pymobiledevice3 remote start-quic-tunnel
  5. pymobiledevice3 developer dvt simulate-location clear --rsd host port,it doesn't work.

but you still can set new location.

@JoeUchihaa
Copy link

In my case, any command without dvt doesnt work, for example:

I can simulate location using:

pymobiledevice3 developer dvt simulate-location set --rsd host port -- x y

but not : pymobiledevice3 developer simulate-location set --rsd host port -- x y

similarly, I cannot simulate motion, speed etc. because there is no dvt option for the .gpx file:

sudo pymobiledevice3 developer simulate-location play "path/to/gpx/file" --rsd host port

any fix for this or a workaround?? I'm on iOS 17 btw.

@c00ni
Copy link

c00ni commented Oct 20, 2023

In my case, any command without dvt doesnt work
any fix for this or a workaround?? I'm on iOS 17 btw.

Why are you seeking a fix or workaround? You need dvt for things to work on iOS 17 due to the changes made.

@JoeUchihaa
Copy link

In my case, any command without dvt doesnt work
any fix for this or a workaround?? I'm on iOS 17 btw.

Why are you seeking a fix or workaround? You need dvt for things to work on iOS 17 due to the changes made.

the thing is play gpx doesnt work either, so i was just pointing that out

@omggodlike123
Copy link

any plans for support fake location for ios 17 on windows? @doronz88

@doronz88
Copy link
Owner

doronz88 commented Nov 1, 2023

@lindaamanda123 see #569

@Dat-Bois
Copy link

Dat-Bois commented Dec 7, 2023

the thing is play gpx doesnt work either, so i was just pointing that out

I am also interested if this feature can be implemented sometime soon for IOS 17. Since simulate-location has been implemented already, I hope this shouldn't be too large of an undertaking. No worries if you are busy.

@doronz88
Copy link
Owner

doronz88 commented Dec 8, 2023

Oh the issue here is the GPX file specifically? It's harder to keep track of different issues in the same one. Can you please create another one for that specifically so I can also tag it in a PR?

Also, most of pymobile subcommands provide an abstraction to the way the protocol messages are consrtructed. In iOS17 the simulate location works very differently over DVT instead of its own relay in the DDI.

@Dat-Bois
Copy link

Dat-Bois commented Dec 16, 2023

Also, most of pymobile subcommands provide an abstraction to the way the protocol messages are consrtructed. In iOS17 the simulate location works very differently over DVT instead of its own relay in the DDI.

I would love to learn more about how this project works and the DVT and DDI protocols you just mentioned, any resources you can suggest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants