Schlaubischlump / LocationSimulator

MacOS application to spoof / fake / mock your iOS / iPadOS or iPhoneSimulator device location. WatchOS and TvOS are partially supported.
https://schlaubischlump.github.io/LocationSimulator/
GNU General Public License v3.0
2.53k stars 196 forks source link

Allow Multiple Devices at Once #83

Closed jeffsawatzky closed 3 years ago

jeffsawatzky commented 3 years ago

This is a first stab and supporting multiple devices. Refs #82 Also fixed some typos.

Note: I AM NOT AN IOS DEVELOPER. :) Please, provide feedback on how to make any of this better.

Also Note: Multiple select on the side bar isn't working...and I don't know how to fix that. But, if I hard code the selectedDevices to just return the list of all self.realDevices the rest of it seems to work.

Schlaubischlump commented 3 years ago

Thank you for the Pull Request ! Selecting multiple devices at the sidebar shouldn't be too hard to implement for me.

The only problem I currently have is that I'm not sure about how this feature should work from the UI side. Currently when you switch the selected device inside LocationSimulator, the spoofed location will be forgotten for the previous device. I plan to change this, so that will work this way:

  1. Select a device and start spoofing
  2. Select a different device => device 1 will pause spoofing
  3. Start spoofing on the second device
  4. Reselect device 1 and continue spoofing where you previously left

If I now allow selecting multiple devices, I'm not sure how I should handle the case where multiple devices are already spoofing. Assume that device 1 and device 2 are currently performing a navigation. I now select both of them simultaneously. What should be shown inside the MapView ? The route of device 1 or the route of device 2 or neither of them ? Should I reset the spoofed location when selecting multiple devices at once ?

Don't get me wrong. This is a feature which I really like and would love to implement, I just don't know how to add it to the UI, without making the process unintuitive.

jeffsawatzky commented 3 years ago

What is the use case for switching between devices frequently? I was doing that before, but only because I couldn't spoof mulitple devices at the same time.

You could show a dialog to the user with something like:

┌─────────────────────────────────────────────────────────┐
│                                                         │
│  The device you are connecting has a previous location  │
│  saved. What would you like to do?                      │
│                                                         │
│  Choose location:                                       │
│  ┌┐                                                     │
│  └┘ Keep current location                               │
│                                                         │
│  ┌┐                                                     │
│  └┘ Navigate to saved location                          │
│                                                         │
│  ┌┐                                                     │
│  └┘ Transport to saved location                         │
│                                                         │
│                                                         │
│                                                         │
│  Choose devices:                                        │
│  ┌┐                                                     │
│  └┘ Keep all devices connected                          │
│                                                         │
│  ┌┐                                                     │
│  └┘ Disconnect devices currently connected              │
│                                                         │
│                                                         │
│                                                         │
│                   ┌────────────────┐ ┌────────────────┐ │
│                   │                │ │                │ │
│                   │       OK       │ │     Cancel     │ │
│  ┌┐               │                │ │                │ │
│  └┘ Save choice   └────────────────┘ └────────────────┘ │
│                                                         │
└─────────────────────────────────────────────────────────┘
jeffsawatzky commented 3 years ago

Could also make multi-device support optional, and off by default