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

[Feature] iOS 17 support #171

Open Schlaubischlump opened 1 year ago

Schlaubischlump commented 1 year ago

iOS 17 is currently not supported. I can give no ETA when it will be supported.

Problem: Automatic download and mounting of Developer Disk Images will not work with iOS 17. LocationSimulator should still work, if you mount the Personalized Developer Disk Image with Xcode first.

According to this issue and that iOS 17 changes how Developer Disk Images are handled. It is not clear if libimobiledevice will support these changes. It is also not clear if I will be able to support these changes and implement this new mechanism in LocationSimulator.

Please do not open multiple issues or ask for an eta in regards to iOS 17 support. I can only start working on this if libimobiledevice is updated to support iOS 17, which (if it happens at all) will be the case in September, when iOS 17 is out of beta and released to the public.

What can you do in the meantime ?

At the moment there is no workaround..

~~1. Install Xcode (Beta).

  1. Setup your device as development device.
  2. Let Xcode handle the new Personalized Developer Disk Image stuff automatically.
  3. Start using LocationSimulator. LocationSimulator should hopefully detect that a Developer Disk Image was already mounted by Xcode. That way, LocationSimulator does not need to handle the mounting of the Developer Disk Image itself.~~

Edit: I might consider migrating to MobileDevice.framework. That way I could support iOS 17 before libimobiledevice is updated. Although I might need to drop Catalina support in this case ? --- Does not work, because MobileDevice.framework does not support iOS 17 and CoreDevice is written in Swift and hard to reverse engineer.

Edit: Pymobiledevice3 works for iOS 17, but only over USB. Also using python in Swift is cumbersome and really slow, because python is slow by nature.

Edit 13.02.2024: There seems to be some progress going on over at go-ios. I think if they manage to finish adding iOS 17 support I can probably migrate my backend to use it with Gomobile. I keep an eye on that and still actively search for solutions to support iOS 17.

Edit 19.04.2024: There is an open pull request at https://github.com/danielpaulus/go-ios/pull/332. Once this is merged I should be able to work on iOS 17 support.

Geczy commented 1 year ago

ty for instructions, was just looking for why it wasn't working with any tool i tried

Geczy commented 1 year ago

confused though. i even got hello world running on xcode 15 beta to prove my device is setup as a development device. where's my personalized image?

i went to the path /Applications/Xcode-beta.app/Contents/Resources/CoreDeviceDDIs that the issue you linked provides and i do see my img there, but the app is still not recognizing it

i cant add it to the app cause it requires a signature which i dont have?

CleanShot 2023-06-14 at 18 22 07@2x CleanShot 2023-06-14 at 18 20 31@2x CleanShot 2023-06-14 at 18 16 41@2x CleanShot 2023-06-14 at 18 16 53@2x CleanShot 2023-06-14 at 18 17 10@2x CleanShot 2023-06-14 at 18 19 31@2x
Schlaubischlump commented 1 year ago

Then I'll probably need to update LocationSimulator to recognize the new mounted image properly. Sadly I can only do this when libimobiledevice is updated :/

I had hoped, that the mechanism to detect the mounted image did not change, but this seems to not be the case ...

I can probably hack LocationSimulator to just not check if the image is mounted. I can try to upload a build on the weekend, that disables automatic DeveloperDiskImage downloads. Then you can check, if it is working with this build

Edit: Try this build. It is unsigned so you probably have to open it with a right click and confirm some warnings. This build just assumes, that the developer disk image is always mounted.

LocationSimulator.app.zip

v-u-n commented 1 year ago

I tried this and I get this error image

Schlaubischlump commented 1 year ago

Have you mounted the DeveloperDiskImage with Xcode by installing some app ?

If so, then apple changed the API. In this case, I can not address this error until September

Geczy commented 1 year ago

same issue here even after mounting via xcode btw

Geczy commented 1 year ago

even using the personalized dev signature + dev image exported from here doesn't make locationsimulator work https://github.com/libimobiledevice/libimobiledevice/issues/1452

CleanShot 2023-06-15 at 12 00 53

Schlaubischlump commented 1 year ago

Thanks for all the testing.

Unfortunately, that means Apple broke more than just the developer disk image mounting. They also changed the API for changing the location or the way to interact with it. In every case this sounds like a major rewrite is required and libimobiledevice needs to be update first, which in my experience takes quite some time.

So for everyone reading this: It will take a long time until iOS 17 is supported. If you can, stay on iOS 16 if you want to keep using this app.

Geczy commented 1 year ago

if you can use https://github.com/doronz88/pymobiledevice3 i think you'll receive location spoof support on ios 17 much sooner, because it already added some support for 17

Schlaubischlump commented 1 year ago

Theoretically swift does support python bindings, but this would require an even bigger rewrite of LocationSimulator. At this point it would be easier to throw the app away and write a new one.

If pymobiledevice has done all the necessary research it should be much easier to port the changes to libimobiledevice. I might even be able to do this myself if I find the time.

Note to myself: Keep an eye on the issue to see if the repo of pymobiledevice with the images comes online.

Schlaubischlump commented 1 year ago

@Geczy

Since you got the Xcode beta up and running, could you maybe test if the location simulation is still working for the iOS Simulator?

Geczy commented 1 year ago

@Geczy

Since you got the Xcode beta up and running, could you maybe test if the location simulation is still working for the iOS Simulator?

yeah it works

CleanShot 2023-06-15 at 14 40 17

Schlaubischlump commented 1 year ago

Perfect, thank you for verifying this ! One thing I don't have to fix. That means, I have more time to fix the iOS support.

Dliix66 commented 11 months ago

Hello ! thanks for all the clarification, I am also down to help if you need further tests while working on this, I'm on iOS 17 + Sonoma + xCode Beta

shadowh4ck3r commented 10 months ago

Perfect, thank you for verifying this ! One thing I don't have to fix. That means, I have more time to fix the iOS support.

We need your magik out there 😀🙏

Schlaubischlump commented 10 months ago

Still waiting for an updated version of libimobiledevice...

Sadly nothing happened over there yet. I don't have the time to update it myself at the moment :/ Lets hope that someone updates it soon.

It seems like pymobiledevice3 is already updated, so the heavy lifting in regards to reverse engineering apples changes is already done.

shadowh4ck3r commented 10 months ago

Thanks. We stay Hopeful then!

Schlaubischlump commented 10 months ago

Looks like there is some progress. iFakeLocation implemented support to mount personalized DeveloperDiskImages using libimobiledevice. pymobiledevice3 already provides a repo with personalized developerDiskImages for iOS 17 (Note to myself: Update the old links for iOS Version < 17 to this repo as well). I might be able to add support to mount personalized DeveloperDiskImages images based on the implementation in iFakeLocation. This would be a first step. Even if I manage to mount the DeveloperDiskImages for iOS 17, location simulation would still not work, since all of this stuff was changed by Apple as well.

That being said, I can not start working on this yet, since I do not have a device to test anything on. Apple dropped support for my iPad in iOS 17. Therefore, I'm left with my primary iPhone as my main development device. Since I need my iPhone on a daily basis I can not risk updating it to a beta version. I'll probably start working on this when iOS 17 is out of beta.

Schlaubischlump commented 10 months ago

Quick update: I updated the LocationSimulator user interface and the download handling source code. It is now possible to add and download personalized DeveloperDiskImages.

It is still not possible to:

  1. Mount a personalized DeveloperDiskImage
  2. Spoof the location of an iOS 17 device
marvinjoa commented 10 months ago

That being said, I can not start working on this yet, since I do not have a device to test anything on. Apple dropped support for my iPad in iOS 17. Therefore, I'm left with my primary iPhone as my main development device. Since I need my iPhone on a daily basis I can not risk updating it to a beta version. I'll probably start working on this when iOS 17 is out of beta.

I had the beta since the beginning and it safe to install the beta now. Critical apps like Sparkasse and other banking apps have worked since beta 1.

gabruconcepts commented 10 months ago

Thanks for your hard-work so far.

Schlaubischlump commented 9 months ago

Some information about the new way iOS devices communicate with macOS starting with iOS 17.

https://github.com/doronz88/pymobiledevice3/blob/master/misc/RemoteXPC.md

shadowh4ck3r commented 9 months ago

Some information about the new way iOS devices communicate with macOS starting with iOS 17.

https://github.com/doronz88/pymobiledevice3/blob/master/misc/RemoteXPC.md

Apple did this refactoring thinking they could beat the curve of Tweaks and jailbreaks... No matter how they try, there will always be a vulnerability that serves as a loophole for us to keep using our tools, The iOS 17 is full of bugs and keeps contradicting some AppStore apps... thanks @Schlaubischlump for this educative explanation... ❤️🚀

Schlaubischlump commented 9 months ago

Thank you for the kind words, but I merely collect the information here. doronz88 has done the hard work of reverse engineering the new protocol.

Most likely apple rewrote the developer tools to get rid of the overhead incurred by usbmuxd. It makes sense, but it is shitty for all existing tools.

cdfornari commented 9 months ago

Any update on this?

Schlaubischlump commented 9 months ago

Nope, currently doesn't look good...

I might be able to get the DeveloperDiskImage mounting to work. But I really don't have the time to add remote XPC support for libimobiledevice. And it doesn't look like anybody over at libimobiledevice has time to implement it either :/

See: https://github.com/libimobiledevice/libimobiledevice/issues/1490

cdfornari commented 9 months ago

thanks 🙏 I think I'm just gonna get an iOS 16 phone somewhere lol

Schlaubischlump commented 9 months ago

I think you can still downgrade. iOS 16.6.1 should still be signed.

SkeletonDoctor commented 9 months ago

It looks like Foneazy MockGo already supports iOS 17, and uses some other script to modify the location.

Schlaubischlump commented 9 months ago

Maybe its written in python. In this case they can just use pymobiledevice3

Lailan commented 9 months ago

Thank you for the wonderful app support. I'm hoping that support for iOS 17 will work out. Thank you very much for your efforts!

Greetings from 🇧🇷

Trupal1223 commented 9 months ago

Any update on Location Spoofer working on iOS 17 ?

Schlaubischlump commented 9 months ago

Currently no update. I started working on the DeveloperDiskImage mounting, but its still not working and even if it was, it wouldn't be enough to support iOS 17.

On top of this I'm pretty busy at work, so I can sadly not give any estimate when I will have time to work on LocationSimulator again :(

If libimobiledevice was fully updated for iOS 17, things would be easier and I could probably implement all changes in a day.

MHV313 commented 9 months ago

Any Similar apps to this one available free/paid, in the mean time ? Don't mind waiting as location simulator beats them all

thecodingcrow commented 9 months ago

@Schlaubischlump @MHV313

you might be interested in https://github.com/Siyuanw/kinesis

small python script with a JS frontend that just does the job. Got it to run on my iOS 17 device straight away and works like a charm

MHV313 commented 9 months ago

@thecodingcrow would you be able to guid me on how to instal it, I'm new to all this

FreezaSama commented 8 months ago

Same @thecodingcrow. I looked into it, but there appears to be a lack of instructions on how to execute it. Would be eager to give it a shot!

stillverySleepy commented 8 months ago

Do we have a ETA of support of iOS 17?

stillverySleepy commented 8 months ago

@Schlaubischlump @MHV313

you might be interested in https://github.com/Siyuanw/kinesis

small python script with a JS frontend that just does the job. Got it to run on my iOS 17 device straight away and works like a charm

This could work for the time it takes for support of iOS 17

Dre-Van-den-Hooff commented 8 months ago

Same @thecodingcrow. I looked into it, but there appears to be a lack of instructions on how to execute it. Would be eager to give it a shot!

I can try and guide you guys through it.

  1. You will need to clone the github repository to your own machine. You can do this by either:

    • Having git installed, and running git clone https://github.com/Siyuanw/kinesis.git in your terminal.
    • Downloading the codebase as a zip file, by clicking the green <> Code button in the top right of the repository, and selecting Download ZIP.
  2. Make sure you have python and pip installed, if you don't, download the latest versions here and here.

  3. Open your terminal, and navigate to the codebase's directory. If you're not sure how to do that, you can find some information here.

  4. Once you have your terminal open at the correct directory, enter the following command: pip3 install -r requirements.txt. Let it install, this might take some time.

  5. Connect your device using USB.

  6. Run following command in the terminal:sudo python3 main.py. It will ask for your password of your computer, type it and hit enter. The program should now be running.

  7. Open a browser (chrome, firefox, safari, ...) and go to http://localhost:3000. If everything works correctly you should be seeing an interactive map.

stillverySleepy commented 8 months ago

for number 6 I meant I keep on getting "NotImplementedError: unsupported platform"

Schlaubischlump commented 8 months ago

The project linked above uses pymobiledevice3. pymobiledevice3 only supports macOS. Did you try to run it on windows or linux ?

stillverySleepy commented 8 months ago

nope ran it on a m1

stillverySleepy commented 8 months ago

i can give you the full error msg

Dre-Van-den-Hooff commented 8 months ago

i can give you the full error msg

Sure, I’ll see what I can do. Best bet is to google or ask chatgpt or something what could be wrong.

Also, these are the devices and versions of software I used which worked, without any issues:

-MacOS: 14.0 (macbook pro 2021) -iOS: 17.0.2 (iphone 13 pro) -python: 3.10.7

Now, I don’t think we should keep polluting this issue with problems about another repository. Let’s try and keep it to a minimum🙂.

stillverySleepy commented 8 months ago

I am on MAC M1 13.4.1 IOS 17.0.2 (iPhone se 2ad gen) Python 3.10.11

IF you want a discord tag for the Error (like you said we should keep it to a minimum)

dgdhgd

chmiiller commented 8 months ago

hey @Schlaubischlump thanks for the updates and for keeping up with this project. I'm also making a location simulator for iOS using libimobiledevice and struggling with iOS 17. I just learned that Xcode 15 has a new devicectl, similar to simctl; as far as I could see, it accepts notifications. Do you think we can pass a notification to simulate location using it? Official docs about devicectl: https://developer.apple.com/documentation/Updates/Xcode Discussions about it: https://github.com/ios-control/ios-deploy/issues/588 and https://github.com/appium/appium/issues/19166

Lubriderm05 commented 8 months ago

I just want to get my life 360 and find my iphone to be spoofed what does all of this mean

Schlaubischlump commented 8 months ago

Hi @chmiiller,

I haven't really looked into that, so I don't know if it is possible. For LocationSimulator I don't want to use notifications even if it is possible, since I don't get any callbacks when the operation is finished. This makes scheduling the next location update operation difficult.

My problem is less getting this to run somehow and more getting location simulation to run on macOS versions as low as Catalina in a way that is maintainable, supports the current feature set and doesn't break all the time.

If you are just interested in simulating the location of an iOS 17 device and you don't care about being compatible with older macOS versions you can probably use Apples MobileDevice framework directly. The API is not publicly documented, but it is easy enough to reverse engineer. I think its quite similar to libimobiledevices API. I think Facebooks idb library uses it internally. You can probably get some inspiration from there.

Other than that you can of course use pymobiledevice3 as mentioned before.

james-w-c commented 8 months ago

Same @thecodingcrow. I looked into it, but there appears to be a lack of instructions on how to execute it. Would be eager to give it a shot!

I can try and guide you guys through it.

  1. You will need to clone the github repository to your own machine. You can do this by either:

    • Having git installed, and running git clone https://github.com/Siyuanw/kinesis.git in your terminal.
    • Downloading the codebase as a zip file, by clicking the green <> Code button in the top right of the repository, and selecting Download ZIP.
  2. Make sure you have python and pip installed, if you don't, download the latest versions here and here.
  3. Open your terminal, and navigate to the codebase's directory. If you're not sure how to do that, you can find some information here.
  4. Once you have your terminal open at the correct directory, enter the following command: pip3 install -r requirements.txt. Let it install, this might take some time.
  5. Connect your device using USB.
  6. Run following command in the terminal:sudo python3 main.py. It will ask for your password of your computer, type it and hit enter. The program should now be running.
  7. Open a browser (chrome, firefox, safari, ...) and go to http://localhost:3000. If everything works correctly you should be seeing an interactive map.

Hey, What do you mean by the codebase's directory? I'm not sure which directory to use.Also, step number 4 gives me an error and i'm not sure why. This it it.

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot7/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-133.100.1.1/altgraph-0.17.2-py2.py3-none-any.whl'