Skip to content

Instantly share code, notes, and snippets.

@masbog
Created March 22, 2013 21:02
Show Gist options
  • Save masbog/5224710 to your computer and use it in GitHub Desktop.
Save masbog/5224710 to your computer and use it in GitHub Desktop.
No GPX No Problem
find the file .plist
here /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/CoreLocation.framework/Support/SimulationScenarios
so u can read like this at Locations key objectAtIndex:0
Item0 | Data | <62706c69 73743030 d4010203 04050828 29542474 6f705824 6f626a65 63747358 24766572 73696f6e 59246172 63686976 6572d106 0754726f 6f748001 a3090a21 55246e75 6c6cdb0b 0c0d0e0f 10111213 14151617 18191a1b 1c1d1e1f 205f1026 6b434c4c 6f636174 696f6e43 6f64696e 674b6579 436f6f72 64696e61 74654c61 74697475 64655f10 246b434c 4c6f6361 74696f6e 436f6469 6e674b65 79566572 74696361 6c416363 75726163 795f101d 6b434c4c 6f636174 696f6e43 6f64696e 674b6579 54696d65 7374616d 705f1026 6b434c4c 6f636174 696f6e43 6f64696e 674b6579 486f7269 7a6f6e74 616c4163 63757261 63795f10 1c6b434c 4c6f6361 74696f6e 436f6469 6e674b65 794c6966 65737061 6e5f1027 6b434c4c 6f636174 696f6e43 6f64696e 674b6579 436f6f72 64696e61 74654c6f 6e676974 7564655f 101a6b43 4c4c6f63 6174696f 6e436f64 696e674b 6579436f 75727365 5f101c6b 434c4c6f 63617469 6f6e436f 64696e67 4b657941 6c746974 7564655f 10196b43 4c4c6f63 6174696f 6e436f64 696e674b 65795370 65656456 24636c61 73735f10 186b434c 4c6f6361 74696f6e 436f6469 6e674b65 79547970 65234042 aaea4888 afe723bf f0000000 00000023 41b2d3bd 684d9168 23401400 00000000 0023403e 00000000 000023c0 5e821540 235ba523 406647ae 147ae148 23000000 00000000 00233ffa b851eb85 1eb88002 1001d222 23242758 24636c61 73736573 5a24636c 6173736e 616d65a2 25265a43 4c4c6f63 6174696f 6e584e53 4f626a65 63745a43 4c4c6f63 6174696f 6e120001 86a05f10 0f4e534b 65796564 41726368 69766572 00080011 0016001f 00280032 0035003a 003c0040 0046005d 008600ad 00cd00f6 0115013f 015c017b 0197019e 01b901c2 01cb01d4 01dd01e6 01ef01f8 0201020a 020c020e 0213021c 0227022a 0235023e 0249024e 00000000 00000201 00000000 0000002a 00000000 00000000 00000000 00000260>
okey... so what did you think about kind of class the data in above ?
okey... its nsdata, where created from :
CLLocation *loc = [[CLLocation alloc] initWithLatitude:(your latitude) longitude:(your longitude)];
NSData *locationData = [NSKeyedArchiver archivedDataWithRootObject:loc];
for unarchiveObject you can write like this, it's simple
NSData *locData = [[NSUserDefaults standardUserDefaults] valueForKey:WhereamiLocationPrefKey];
CLLocation *loc = [NSKeyedUnarchiver unarchiveObjectWithData:locData];
right now you can use this methode to add new fake location at ios simulator Debug -> Location -> "Your Custom Core Location"
generate first from your GPX file or KML file, than save it to .plist , add to simulator directory...
see my screenshot :) http://grab.by/kXmU
bye...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment