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.39k stars 184 forks source link

[BUG] App crashing when trying use a device #134

Closed nicmayol closed 1 year ago

nicmayol commented 1 year ago

Hi there, I find this application very helpful, thanks a lot for developing it !

But when I tried to play it today, the app just crashed when I clicked on my device. I'm using the latest version I think (0.1.9.3), and didn't do anything on my device. I was using iOS16, and updated to 16.0.2, but it didn't change anything. Also tried with an old phone under 15.6.1, but it was the same.

I tried deleting the folder LocationSimulator as in topic #133, and even tried deleting all files and app, and reinstalling via homebrew, but the issue still occurs.

I attached the full issue report. LocationSimulator-2022-10-02-122155.pdf

Thanks

Schlaubischlump commented 1 year ago

Thanks for you detailed crash report. It looks like macOS has a problem with my threading code. This is hard to fix, since it does not appear on my machine and it could theoretically depend on some other application / process running on your PC. Or it could have something to do with the fact, that you use an M1 mac. I saw that you use macOS 12.6. Have you recently installed an update for macOS, even if it is just a security update ? Or did your mac maybe automatically install an update ? I currently use macOS Ventura, where the bug does not appear.

  1. Could you try rebooting all your devices, including you mac, just to make sure that it has nothing to with some corrupted memory.
  2. After the reboot can you try to disable the wi-fi detection feature in the LocationSimulator -> Network settings and keep it off. Then connect your device via USB and see if the error still occurs.

Can anybody else with macOS 12.6 (21G115) reproduce this behaviour ?

nicmayol commented 1 year ago

Hey, thanks for the anwser. I tried to reboot both my mac & iPhone but the app still crashes.

I installed an update a couple of weeks ago, and I may have not used the app since then (I really can't remember tho)

Schlaubischlump commented 1 year ago

Did you also try with the network detection off ?

Monterey Ventura is still in beta. You could try installing it, but it might not fix your problem and might cause new problems in other programs, since it is still a beta version of macOS. So I would generally advice against installing it.

nicmayol commented 1 year ago

Sorry, I edited my previous message since I already have Monterey. Btw I can't access network detection settings, here's what I have when I try to go to the app settings :

Capture d’écran 2022-10-02 à 14 29 48
Schlaubischlump commented 1 year ago

Okay this looks completely broken.

I think it has something to do with a corrupted saved application state or corrupted user defaults.

Try the following:

  1. Close the application
  2. Delete the folder mentioned in #133 (this should delete the save application state)
  3. Open Terminal.app in Applications/Utilities copy and paste the following command:

defaults delete de.davidklopp.locationsimulator

And hit enter.

  1. Try to open LocationSimulator

If all this does not work you could try creating a new user account on your mac (or activate the guest account). Then log into this account and see if the application is working there.

nicmayol commented 1 year ago

I had already tried deleting this folder. Just did it again now, but then on step 3 terminal says

Domain (de.davidklopp.locationsimulator) not found.
Defaults have not been changed.

EDIT : still crashes on guest session..

Schlaubischlump commented 1 year ago

Strange, that it can't find the domain.

LocationSimulator.app.zip

Can you see if this download works ? I might have an idea why it behaves so strange.

nicmayol commented 1 year ago

Nah, still crashes :/

Schlaubischlump commented 1 year ago

What output is generated if you start LocationSimulator via Terminal using:

/Applications/LocationSimulator.app/Contents/MacOS/LocationSimulator

nicmayol commented 1 year ago
/Applications/LocationSimulator.app/Contents/MacOS/LocationSimulator
[22-10-02 14:53:35.812404][INFO][40230]: Logger: Using log file: /Users/Nicolas/Library/Containers/de.davidklopp.locationsimulator/Data/Documents/logs/log.txt
[22-10-02 14:53:35.953309][INFO][40230]: Device "00008101-000E215E0181001E" - iPhone de Nicolas: Connected.

The app opens, asking me if it can access my position, I hit yes, then I try to select my device but the app crashes

nicmayol commented 1 year ago

And also : [22-10-02 14:53:54.601292][INFO][40281]: Device "00008101-000E215E0181001E": DeveloperDiskImage is already mounted. [22-10-02 14:53:54.611388][INFO][40230]: DeveloperDiskImage download links: Not found. Using fallback... 2022-10-02 14:53:54.628 LocationSimulator[2901:40230] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSAlert: Alert created with empty message and buttons. Please provide informative content for the alert and a means to acknowledge it.' First throw call stack: ( 0 CoreFoundation 0x0000000195575148 exceptionPreprocess + 240 1 libobjc.A.dylib 0x00000001952bfe04 objc_exception_throw + 60 2 CoreFoundation 0x0000000195574f94 +[NSException exceptionWithName:reason:userInfo:] + 0 3 AppKit 0x00000001984766a4 -[NSAlert buildAlertStyle:title:formattedMessage:first:second:third:oldStyle:] + 2204 4 AppKit 0x0000000198395114 -[NSAlert layout] + 432 5 AppKit 0x00000001983ac71c 54-[NSAlert beginSheetModalForWindow:completionHandler:]_block_invoke + 48 6 AppKit 0x00000001983a9530 -[NSAlert beginSheetModalForWindow:completionHandler:] + 140 7 Foundation 0x00000001963c5d78 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 916 8 Foundation 0x00000001963c5824 -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 136 9 LocationSimulator 0x0000000102f962f0 LocationSimulator + 41712 10 LocationSimulator 0x0000000102fbd0a8 LocationSimulator + 200872 11 LocationSimulator 0x0000000102fbe260 LocationSimulator + 205408 12 LocationSimulator 0x0000000102f95750 LocationSimulator + 38736 13 libdispatch.dylib 0x00000001952625f0 _dispatch_call_block_and_release + 32 14 libdispatch.dylib 0x00000001952641b4 _dispatch_client_callout + 20 15 libdispatch.dylib 0x00000001952726cc _dispatch_main_queue_drain + 928 16 libdispatch.dylib 0x000000019527231c _dispatch_main_queue_callback_4CF + 44 17 CoreFoundation 0x0000000195536998 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16 18 CoreFoundation 0x00000001954f3c08 __CFRunLoopRun + 2532 19 CoreFoundation 0x00000001954f2a84 CFRunLoopRunSpecific + 600 20 HIToolbox 0x000000019e132338 RunCurrentEventLoopInMode + 292 21 HIToolbox 0x000000019e1320b4 ReceiveNextEventCommon + 564 22 HIToolbox 0x000000019e131e68 _BlockUntilNextEventMatchingListInModeWithFilter + 72 23 AppKit 0x000000019805a51c _DPSNextEvent + 860 24 AppKit 0x0000000198058e14 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1328 25 AppKit 0x000000019804afe0 -[NSApplication run] + 596 26 AppKit 0x000000019801c6fc NSApplicationMain + 1132 27 LocationSimulator 0x0000000102f8e75c LocationSimulator + 10076 28 LocationSimulator 0x0000000102f8e724 LocationSimulator + 10020 29 dyld 0x000000010332108c start + 520 ) libc++abi: terminating with uncaught exception of type NSException zsh: abort /Applications/LocationSimulator.app/Contents/MacOS/LocationSimulator

Schlaubischlump commented 1 year ago
193453994-7ce29e64-4f3e-46bf-bca2-5039a0e59180

Okay this looks all normal, except for the crash report that I already saw... I got one last idea:

  1. Open LocationSimulator and close the preference window. (See the screenshot I attached)
  2. Close LocationSimulator
  3. Delete the folder in #133
  4. Start the LocationSimulator version I linked in this issue

If this still doesn't work I'm sadly out of ideas for the moment...

nicmayol commented 1 year ago

Still doesn't work :(

Schlaubischlump commented 1 year ago

You could try running you mac in save mode. This will clear all caches, but at this point I don't really think it will help either:

See: Start up your Mac with Apple silicon in safe mode

https://support.apple.com/en-gb/guide/mac-help/mh21245/mac

nicmayol commented 1 year ago

Just tried it, but in sade mode my devices are not recognised

Schlaubischlump commented 1 year ago

But is the window still broken like in you screenshot? Usually you should see toolbar icons

nicmayol commented 1 year ago

It still is too :/

Schlaubischlump commented 1 year ago

I think I figured out what your problem is. The french language support is very, very incomplete. The missing language is the reason why the window looks so broken and crashes if you try to select a device. I'll either have to remove the language support for all languages except for english and german or fallback to using the english words... I'll try to look into this, this evening and upload a new release when the error is fixed.

What can you do for now ? You can permanently change the language of LocationSimulator to english by adding an application specific entry inside the settings app. See Choose the language you use for individual apps.

Or you can use this app to temporarily change the language of LocationSimulator to english.

Edit: @nicmayol I uploaded a new release on github. Could you check if everything is working now ?

nicmayol commented 1 year ago

Hey ! Thanks a lot for this solution, I changed the language of the app via my mac settings and it works normally ! I think removing the unstable language versions would be a good thing ;)