Force fake location on device? - iphone

I need to demo my app to my supervisor. At the minute I have set all the testing up so that it works with the highway drive in cali. When I demo it I will be in an office (stationary) so the real location data for the phone wont show the demo results at all.
Is there anyway to make the iphone do the city drive? - When its running natively i.e. not connected to the machine.

There are various CLLocationManager simulators on github that you could include in your demo build, such as the CLLocationManager_simulator here.
Alternately you can set up your apps to record location data to a file and then create a CLLocationManager simulator that plays back the file. With that testers can record test drives and then devs can play them back in the office to debug or examine what happened or retest with new builds.

If you don't mind using the Simulator to demo it, there's simulated location available. Look in the Simulator menu under Debug -> Location.

Related

Simulating a location on Real iOS Device

Is it possible to simulate a location on iOS Device, say I want to simulate London on the device while I am sitting in Oxford?
Thanks.
Yes, It is possible to simulate the location on device in debug mode. All you need is to debug your application on device, and then enable the location from debug menu.
Check this link...
https://developer.apple.com/library/ios/recipes/xcode_help-debugger/articles/simulating_locations.html
You can create a GPX file with the desired location/coordinates and you can enable it from the debugger or from the Project scheme select run/options/"Allow location simulation".
After you have this enabled and your device connected the location simulation will work on the device to till you reboot it.
A good article that explain this can be found here: https://blackpixel.com/writing/2013/05/simulating-locations-with-xcode.html
Maybe this project can help: https://github.com/futuretap/FTLocationSimulator
It simulate location sending fake data to the coreLocation.

What folders and files gets backed up through iTunes?

Everytime I get a call my old wallpaper shows even though I have a new one. I'm trying to find it on my iOS but I cannot seem to figure out where. So I'm trying to track down what folders gets backed up when i backup my iPhone since I have restored it and it's still there.
(I'm using a jailbroken device)
I know this isn't the actual folder names and etc but it will give you an idea what it's backing up though. Good Luck.
With iOS 1.1 and later
Safari bookmarks, cookies, history,
and currently open pages
Map bookmarks, recent searches, and
the current location displayed in
Maps
Application settings, preferences,
and data
Address Book and Address Book
favorites
Calendar accounts
Wallpapers
Notes
Call history
Mail accounts
YouTube bookmarks
SMS messages
Saved suggestion corrections (these
are saved automatically as you reject
suggested corrections)
Camera Roll (photos and screenshots
taken by the iPhone)
Voicemail token (This is not the
Voicemail password, but is used for
validation when connecting. This is
only restored to a phone with the
same phone number on the SIM card.)
Web clips
Network settings (saved Wi-Fi
hotspots, VPN settings, network
preferences)
Paired Bluetooth devices (which can
only be used if restored to the same
phone that created the backup)
Keychain (this includes email account
passwords, Wi-Fi passwords, and
passwords you enter into websites and
some other applications. The keychain
can only be restored from backup to
the same iPhone or iPod touch. If you
are restoring to a new device, you
will need to fill in these passwords
again.)
With iOS 2.0 and later (in addition to the above)
Managed Configurations/Profiles
List of External Sync Sources (Mobile Me, Exchange ActiveSync)
Microsoft Exchange account configurations
Nike + iPod saved workouts and settings
App Store application data (except the application itself, its tmp and caches folder).
With iOS 3.0 and later (in addition to the above)
Videos in Camera Roll
Per app preferences allowing use of location services
Offline web application cache/database
Voice Memos
Autofill for webpages
Trusted hosts having certificates that cannot be verified
Websites approved to get the location of the device
In-app purchases
New with iOS 3.1: Videos in the Camera Roll that are 2 GB or larger are not backed up (iOS 4 and later will back up videos 2 GB and larger)
All user documents and settings get backed up, Application settings as well as system settings.
Applications each have a Documents folder that user data can be saved to, so thats pretty much what gets backed up for applications, including app preferences.
These are the Wallpaper locations:
/private/var/mobile/Library/SpringBoard/HomeBackground.jpg
/private/var/mobile/Library/SpringBoard/HomeBackgroundPortrait.jpg
/private/var/mobile/Library/SpringBoard/LockBackground.jpg
/private/var/mobile/Library/SpringBoard/LockBackgroundPortrait.jpg
I have manually managed to find out what gets backed up and managed to solve the problem :)
I downloaded the trial of iphone packup extractor http://www.iphonebackupextractor.com/ and found what I was looking for.
Also it seems like I just had to change the lockscreen in the iPhone since the file called LockScreen.jpg was the picture I was looking for but since I had another lockscreen using winterboard I didnt think of this.
Good luck to anyone else who has problems similar to this.

output different from simulator and iphone device

The output from simulator and iphone device is different. what is the actualy problem?can download the sample code from below link. the path of the road is not the same for both. i also need to move the car from start to end with the validation. currently my validation is not working.all the details are in Readme
Link Download (1.3MB)
There are a lot of situations where the behavior of the simulator and the device differs. Mostly they are triggered by bugs in your code, like messing up your memory management or trying to write to a file that isn't writable on the device.

How to test location based iPhone application during development?

I am currently developing a location based iPhone application. Is there any way to test the app other than taking the iPhone to different places?
Thanks
Yes, you can.
Try this: http://www.vimov.com/isimulate/
(...) With iSimulate installed on their iPhones however, their multi-touches on the iPhone (which gets interpolated for the larger iPad screen), the movement recorded by the accelerometer, the location and orientation captured by the GPS and Compass, all get wirelessly sent to the iPad Simulator, so they can develop virtually any application they want, before the iPad is itself released!
Even though an answer have long been accepted for this question I'll still chime in with some additional information on the topic.
The kind folks at FutureTap have mad the FTLocationSimulator available for free at GitHub. It allows you to prepare a test route using for instance Google Earth, and then have the simulator feed these coordinates to your app.
I've written a blog post about how to use FTLocationSimulator to easily switch between multiple routes during testing of the location features.

Disable location service in iPhone simulator?

I'd like to test what happens if my app can't get the location coordinates. Is it possible to disable the location service in the simulator, like on an iPod Touch with WiFI turned off?
I still don't have my iPhone Developer Program certificate, so I can't test it on my device.
Thanks in advance!
You can disable the location services in the simulator;
Run your app through xcode so the simulator opens
Stop the app via xcode (this should leave the simulator open)
Open the Settings app in the simulator window
Privacy > Location Services. Disable Location Services
Run your app again, location services should be disabled
Hope it helps!
As a workaround you can try to simulate update location failure by constructing NSError object with appropriate values and calling corresponding CLLocationManager delegate didFailWithError: method manually.
To my knowledge, you can't disable the location service on the simulator.
The approach that I normally use when using the location service is to build a simple wrapper class arround NSLocation tailored to the needs of my application.
In this wrapper, you could easily pretend that the service is not working in the simulator. For example, it could have a "isEnabled" method that returns false on the simulator with a compiler define like (#if TARGET_ IPHONE_SIMULATOR)
**Disregard this. This works around the MapKit. Check comments below.
Disconnect the computer from internet connection. How to.
EDIT: You can test the code from this site that can be downloaded here
With AirPort on, you get the map. With the AirPort off you get a blank squared view.