Add GPX File to Xcode 6 Project - ios

I am following the Trax app demo from Stanford's iOS lectures and the instructor set the app up to handle GPX files via AirDrop, but the iPhone simulator doesn't support AirDrop.
Is there anyway to add files (more specifically GPX files) to an app on the iPhone simulator? I thought about emailing it to myself and using Safari on the simulator, but I have no idea where that would be stored or how to access it from the Trax app.

You can add a GPX file to a project by opening the scheme editor: Product -> Scheme -> Edit Scheme. Under Options check the Allow Location Simulation box and from the dropdown choose Add GPX File to Workspace.
In order to generate a GPX file with your custom location you can use this.

The way Hegarty does it is he runs the app on his phone (when connected and registered your phone will be the first scheme on the list). Then airdrop on the Mac will see your phone and you're app will grab it.

Related

Access other .ipa's files installed on my iphone via my app

Can I access other .ipa files present on my iphone via my app and pass it to the backend server.
Will I be able to do that after jailbreak? If not on a non-jailbroken device.
The short answer is NO.
Other than that you can register the app as an app that works with different file types and the user can open them manually. Take a look of different App Extensions types Document Provider and Share.
You can't get exact IPA file.
You can get it's container from XCode if it is your app, In container you will found document directory of app where you might have saved data to get this
Goto xcode -> Device And Simulator -> Select your Device -> choose Application
Press Setting button on bottom and press download container

Can I accept a file via Drag & Drop from the Mac to the iOS Simulator?

For debugging purposes I want to accept a JSON file from the Mac via drag & drop in the iPad simulator.
I implemented UIDropInteractionDelegate and can successfully accept drops from the iPad Files app. But ideally I'd like to accept drops directly from the Mac.
Right now, when dragging a JSON file into the Simulator, the Files app is opened and handles the drop.
I doubt it's possible but if someone has any idea (even private API, since it's for debugging only), please let me know.
You can accept dropped files in the iOS Simulator by configuring your app to open documents of type you want to import. You can do this via CFBundleDocumentTypes in your Info.plist, or by using the Info tab in your target's build settings. The UTI for JSON files should be public.json.
When you've configured your app to handle JSON files, simply implement application:openURL:options: in your app delegate to actually handle the drop.

How do I find out if an IOS app uses frameworks/framework libraries

How can I figure out if an app in the IOS appstore uses frameworks? I would like to be able to know if it uses frameworks and possible what frameworks are used, without actually downloading the app.
Secondly, how do i figure out the frameworks used if provided the app's ipa file?
Finding out what frameworks an app in the Appstore uses may be a futile process, but it is possible to find them if one has an ipa file. Here is the process:
Convert the ipa file to a zip file by renaming it to ".zip" instead of ".ipa". For example, "test.ipa" should be renamed to "test.zip"
Unzip test.zip using whatever tool you chose.
Navigate to the test/Payload. You should see a ".app" file in that location.
Right-click on the file and select "Show Package Content" in the popup menu.
Expand the frameworks folder to view the frameworks. Files within this folder have the ".dylib" extension.
You need an iOS device like iPhone / iPad / iPod with an AppStore account set up, a macOS device like iMac, Apple Configurator 2 app (AC2).
First of all you have to download / buy the app which you want to analyze on your iOS device then connect this device to the macOS device and launch the AC2 app. Once the app was launched go to account settings and connect to your AppleId account. Next, right click on the device icon and select "Add->Apps..." action. A modal window will present. Select an applications which you would like to analyze and then download those apps.
Once the applications will be downloaded the AC2 app will ask you to select an action. At this moment don't select any action, instead go to location " Open Finder and go to a folder "~/Library/Group Containers/K36BKF7T3D.group.com.apple.configurator/Caches/Assets/TemporaryItems/MobileApps" where are stored downloaded apps.
Last thing is to change the extension of the iPad file to zip, do it with Finder app in menu under right click select option "open archive". Once there, go to payload and frameworks folder which contains all frameworks used by the app.

How to set fake GPS location on IOS real device

Currently I have to test app and set the different fake GPS locations on real IOS 7 devices. On Android I use 'My Fake Location'. Unfortunately, I didn't find the same app for IOS 7.
Any ideas to solve my problem?
When running in debug mode you can use the little arrow button in the debug area (Shift+Cmd+Y) in Xcode to specify a location. There are some presets or you can also add a GPX file.
You can generate GPX files here manually: http://www.bikehike.co.uk/mapview.php
(from answer: https://stackoverflow.com/a/17478860/881197)
Create a .GPX file with xcode, then specify your coordinates and when your device connected, hit the little arrow button and select your .GPX file.
You can create multiple files and add lots of coordinates to single .GPX file in order to make some kind of route.
Of course ios7 prohibits creating fake locations on real device.
For testing purpose there are two approches:
1) while device is connected to xcode, use the simulator and let it play a gpx track.
2) for real world testing, not connected to simu, one possibility is that your app, has a special modus built in, where you set it to "playback" mode. In that mode the app has to create the locations itself, using a timer of 1s, and creating a new CLLocation object.
3) A third possibility is described here:
https://blackpixel.com/writing/2013/05/simulating-locations-with-xcode.html
Working with GPX files with Xcode compatibility
I followed the link given by AlexWien and it was extremely useful: https://blackpixel.com/writing/2013/05/simulating-locations-with-xcode.html
But, I spent quite some time searching for how to generate .gpx files with waypoints (wpt tags), as Xcode only accepts wpt tags.
The following tool converts a Google Maps link (also works with Google Maps Directions) to a .gpx file.
https://mapstogpx.com/mobiledev.php
Simulating a trip duration is supported, custom durations can be specified. Just select Xcode and it gets the route as waypoints.
xCode is picky about the GPX file it accepts.
But, in xCode you can create a GPX file with the format it will accept:
And then just change the content of the file to the location you need.
you can do it on real device by run device in Debug mode
Click Debug->Simulate Location -> add .gpx file for your location during run time
I had a similar issue, but with no source code to run on Xcode.
So if you want to test an application on a real device with a fake location you should use a VPN application.
There are plenty in the App Store to choose from - free ones without the option to choose a specific country/city and free ones which assign you a random location or asks you to choose from a limited set of default options.
it seems with XCode 9.2 the way to import .gpx has changed, I tried the ways described here and did not do. The only way worked for me was to drag and drop the file .gpx to the project navigator window on the left. Then I can choose the country in the simulator item.
Hope this helps to someone.
There are one solution for fake GPS in ios simulator and real device. we can use GPX file for fake GPS and simulation.
I followed the step by step guidelines of GPX file use in Xcode with simulation.
Here is full step by step guidelines of GPX file use. And also you can download the GPX file Demo from github.

Get data from user test on device to mac

I'm doing some user tests of my new iOS app and store some test data in a plist. When I do that in the simulator it is easy to get that file for further analysis on my mac, but how can I easily get it from a real device? This will only be used during testing and will not be part of the final version.
Possible ways I have read about but not tried (in hope to get some directions here first):
E-mail attachment
Enable file transfer to iTunes
Jailbreak (but don't want to)
Currently what I am doing is to NSLog it and copy and paste from Xcode into Excel, but this requires that the device is tethered to my mac.
Any experience or advice on easiest way to get this done?
I sometimes use iPhone Explorer to do this, because the plist file I want is not in my Documents folder. I use it to navigate to the files associated with my app on the device. Just connect your device to your laptop, run iPhone Explorer and then use it to locate the plist file you want and drag and drop it wherever you want.
You can save data from Organizer. Just click on your device and it'll show in right pane. Files from documents folder and possibly other folders can be saved.

Resources