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.48k stars 190 forks source link

Device switches when new device is detected #28

Closed Schlaubischlump closed 3 years ago

Schlaubischlump commented 3 years ago

Setup:

  1. A device is connected over USB (or Wi-Fi ?) and is currently spoofing the location.
  2. Connect additional devices over Wi-Fi (or USB?)

Bug: The new device is selected and the location spoofing stops.

Expected behaviour: The new device appears in the list without changing the current selection.

This bug was reported by @marvinjoa. I'm unable to reproduce this error. If anybody else experiences the error please let me know how to reproduce it.

Schlaubischlump commented 3 years ago

@marvinjoa could you download the latest release and test something ? I added some debugging information, which might help me understand the bug.

If you download LocationSimulator.app.zip, you need to execute the following command inside Terminal.app after placing the app inside the application folder: xattr -dr com.apple.quarantine /Applications/LocationSimulator.app. Somehow mac OS does not like the fact that I'm using unsigned libraries anymore and this allows you to run the app nevertheless.

  1. Enter /Applications/LocationSimulator.app/Contents/MacOS/LocationSimulator inside the Terminal and press enter
  2. LocationSimulator should now start and generate output inside the window

Your output should look something like this:

[INFO]: Connect device: DEVICE_NAME with UDID: MY_UDID
[INFO]: Uploading /Users/MY_USERNAME/Library/Application Support/LocationSimulator/IOS_VERSION/DeveloperDiskImage.dmg
[ERROR]: mount_image returned -256
[INFO]: Disconnect device: DEVICE_NAME with UDID:  MY_UDID
[INFO]: Connect device: DEVICE_NAME with UDID:  MY_UDID
...

You can see that I replaced my device name, udid and username. You should do the same for privacy reasons. I just need to be able to see which device connects and disconnects. So maybe instead of John's iPhone use the letter A and for Mom's iPhone the letter B. You get the idea. The udid is not important. You can delete it if you want to.

The only time LocationSimulator should try to upload the DeveloperDiskImage is when no device is connected and you connect the first device. If this is the case, then your log from above should show that all devices are disconnected and then a new device connects before you see the error message. If this is not the case than this is a clear sign that I made some coding bug.

marvinjoa commented 3 years ago

Will do as soon as I've got time to do that. Thanks!

marvinjoa commented 3 years ago
Last login: Thu Nov  5 23:40:58 on ttys000
M@Marvins-MacBook-Pro ~ % /Applications/LocationSimulator.app/Contents/MacOS/LocationSimulator
[INFO]: Connect device: iPhone von Marvin with UDID: 1
[INFO]: Uploading /Users/M/Library/Application Support/LocationSimulator/14.2/DeveloperDiskImage.dmg
[ERROR]: mount_image returned -256
[INFO]: Connect device: Marvin’s iPhone with UDID: 2
[INFO]: Connect device: X's iPhone with UDID: 3
[INFO]: Disconnect device: X's iPhone with UDID: 3
[INFO]: Connect device: X's iPhone with UDID: 3
[INFO]: Disconnect device: X iPhone with UDID: 3
[INFO]: Connect device: X's iPhone with UDID: 3
[INFO]: Disconnect device: X's iPhone with UDID: 3
[INFO]: Connect device: X's iPhone with UDID: 3

Okay so this release somehow doesn't interfere with the wired connection on the App itself anymore - aka it won't favor the Network connection over a USB one.

iPhone von Marvin is still always the first device it connects to, even tho I never used it with the App before, neither did I use my Moms (X's iPhone) with the App.

Every 30-60 seconds, it tries to connect to my mothers iPhone which is locked but charging via AC, while being on a wired connection. It won't cancel the USB connection for that anymore though.

I also found the new settings feature to disable network devices, which I will use after I finished this post.

Marvin's iPhone is my main device which is the only one I use with your App via USB.

So far the latest release works great. I also didn't had to create a gatekeeper exempt, mostly cause I have all the dependencies installed anyway.