Looking into app folders during iPhone development - iphone

My app creates folders on the iPhone, stuffs files into them, moves them around, and so on. I'm trying to debug some hiccups in this behavior, but am finding it hard to see what's actually going on with the files and folders. Is there a way I can look into the folder hierarchy of the iPhone simulator or of a dev-tethered iPhone at all like I could with Finder or a command prompt on my mac?

Yes, the files will be in the simulator's workspace. They're located at the following path:
~/Library/Application Support/iPhone Simulator/<version>/Applications/<uuid>/
For version, choose the version number of the iOS version you installed your app to in the simulator (e.g., 4.2). When your app is installed in the simulator, each app is given some GUID, so look in each of these until you find the app you're testing. Under that directory will be what your app sandbox will look like on the phone. You can see all the files that your app created in the simulator there, and you can watch them in Finder or whatever you'd like.
Be aware, however, that each time you hit the 'Build and Run' command targeting the simulator, a new GUID will be generated and your app will be relocated to that directory. This is similar to what happens when the user updates your app on the phone.

Related

Jailcoder how to

I just tried to get my own app on my iPhone without a developer account. The following are steps I did:
I patched Xcode and my project (Currency.xcodeproj) with JailCoder
I want to build the project with "iOS device" in Xcode. But I got a error message like "no device found". So I ran it in the emulator and I got the currency.app-file in /Users/Dogan/Library/Developer/Xcode/DerivedData/Currency-gjxrulouxbmjslbzslsplyehgfgm/Build/Products/Debug-iphonesimulator
SSH to iPhone in /var/mobile/Applications
Creating a new folder named FADE9826-4878-4458-B5BE-90AD4EB60FDF (I have to take a valid UDID. Have I use to specific tools to create a UDID? I have the UDID from an other example). I also created a directory in this folder with the name "Documents".
chown -R mobile FADE9826-4878-4458-B5BE-90AD4EB60FDF
scp -r Currency.app root#IP-ADRESS-OF-IPHONE:/var/mobile/Applications/FADE9826-4878-4458-B5BE-90AD4EB60FDF/
Restarting Springboard in SSH with "killall SpringBoard"
I got the app, but it doesn't work. Every time on click, it crashes and kicks me to the home screen. Had I missed something?
You missed that simulator builds don't work on iPhones, because they are built for the wrong CPU type. Simulator builds are Intel x86 apps, and the iPhone has an ARM CPU.
There might be other problems (I don't know how jailcoder works) but there's no way you're getting the simulator build running on the phone.
After downloading Jailcoder and going through the guided patch of Xcode and then patching your project, if your device is plugged into your computer, select the target type (where you can select simulator, iOS Device, etc.) and there should be a listing of your device's name.

Where does the compiled .ipa reside when I compile and deploy the app for the iOS simulator from Xcode?

I'd like to be able to pass around the version of my iphone application that was compiled for the simulator. The idea here is to be able to give copies of the app to different vms where they would deploy the app to the iOS simulator and run some tests.
But after I compile the app for the iOS simulator, I can't find the darn *.ipa. Does anyone know where it resides?
There’s no .ipa—Xcode copies the .app bundle by itself into the simulator. You can check:
~/Library/Developer/Xcode/DerivedData/YourProject-<some garbage>/Build/Products/Debug-iphonesimulator/
(swap Debug for Release if you’re looking to distribute a release build, obviously), or, alternately, get the version that’s actually installed in the simulator from:
~/Library/Application Support/iPhone Simulator/<OS version>/Applications/<some UUID>/.
You can copy that app bundle into another simulator by creating an arbitrarily-named folder in the above Applications directory and placing the .app inside it.
You can see where it is putting your build products by looking on:
Xcode Menu-> Preferences-> Locations
Or if you have project Specific settings they will be found by looking on
Xcode Menu-> File-> Project Settings
I think it builds the ipas from the products in those locations and loads them into the simulator. So you might not find an actual .ipa there you find .app in these locations.
If you want an ipa. Do an Archive build.
Do an Ad Hoc distribution and save the resulting .ipa to your desktop.
have you already tried the following location???
Library/Developer/Xcode/DerivedData

Installing iPhone app onto device from Xcode, no files installing with app

I've just set up a new computer and now trying to install my app onto my device through xcode. I've installed the certificates, developer provisioning files, etc..
The app is being installed onto my device, but none of the .png files are being loaded. So my app has the UIButtons and UILabels but nothing else is showing up in my app. Even though the simulator is running the app perfectly.
This app was just installing fine on my old computer to my device, with all the files included. Same version of Xcode and I'm not aware of any changes to settings I made that would have caused this.
No issues or errors when building the app, everything looks good.
Xcode 4.2.1, iPhone 4S 5.0
Thank you
There's sometimes strange things like that which cache themselves in the DerivedData or BuildIntermediates folders of your Xcode project so rebuilding doesn't actually get any changes through. You may want to try Product > Clean and then build again, and then if nothing changes jump into the Xcode Organizer (Window > Organizer) and delete the Derived Data from the project. This will force a reindex of all the project files and any trace of prior builds will be deleted. It should then pick up all of the images as listed in your Copy Bundle Resources build phase(s).

Can I access the App Store from within the iOS Simulator?

Within the iOS Simulator, is it possible to access the App Store?
That is, can I install the App Store application within the Simulator and download applications through it to the iOS Simulator? If so, how?
It's a simulator not an emulator. Even if there was an App Store in the Simulator, none of the apps in the store would work since they are compiled for ARM CPUs while the Simulator runs x86 code.
Sorry it is not available! The simulator will only allow you to install programs from xCode. I am not sure why they restrict this - but I am also not sure why you would want to use the Simulator for this purpose.
Interacting with iOS Simulator: https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/iOS_Simulator_Guide/InteractingwiththeiOSSimulator/InteractingwiththeiOSSimulator.html
Note: You cannot install apps from the App Store in simulation environments.
You can put application in your simulator. But you cannot run it. They have restricted users to run applications. I found where the .app files are.
Machintosh HD - Application - Xcode - Contents - Developer - Platforms - iPhoneSimulator.platform - Developer - SDKs - iPhoneSimulator.sdk - Applications
All applications are in there but, I can't run them. However, I succeeded to install .app files.
In .ipa file, there is 'payload' folder, and .app file is in there.
All you need is just copy it and paste it in Applications folder. Then you can see the icon on your simulator.
But, it will not work.
Probably wont work, but if you have an IOS device and copy an app onto your computer, you might be able to run it on IOS simulator, as you can run your own apps.

How to check my app on client's simulator

Is there any way that client can check my app on his simulator what should i do for that...I do not want to send code of my application to him.....
I know adhoc is required to test on device but here i want to run on his simulator...
Build your app for the iPhone Simulator (iOS 4.2 on this example) and run it from Xcode.
The app should now be stored in a coded subfolder under
~/Library/Application Support/iPhone Simulator/4.2/Applications/ (e.g. ~/Library/Application Support/iPhone Simulator/4.2/Applications/E5548CB9-0A50-49EF-92AB-39F10820D9D6/)
Send your client the whole subfolder (E5548CB9-0A50-49EF-92AB-39F10820D9D6) and tell him to copy it over to /Library/Application Support/iPhone Simulator/4.2/Applications/, then run the iPhone simulator. He should be able to see the app on the simulator and run it. Note that the app will probably appear on the second 'page' of the simulator, so you client may need to scroll to the right.
You can test this between different machines at your own office prior to sending it to your client. He'll have to have Mac OS X 10.6 with the latest iOS SDK installed of course.
Go: Macintosh HD\Users\ YourUserName\Library\Application Support\iPhone Simulator\ iPhoneVersionNumber\Applications:
Then you have to look through each "AJ2783FO29ZO38-WSOHF93" weirdly named folder and find the one that is your app folder. Copy it and put it in the same place on your clients computer.
I have not personally tried this myself. Let me know if you need any other information!
There is no Apple supported method. However if you quit your Simulator after installing your app, zip up your entire Library Applications Support directory for the iPhone Simulator, send it to the client and have the client replaces theirs (after a backup of their Library, or maybe running in another Mac User account). Then when they start their Simulator (has to be from the exact same Xcode/SDK installer as yours), they will see a clone of your Simulator, with your app installed.
Trying to copy just the app bundle may or may not work, as some versions of the Simulator depend on metadata elsewhere within the App Support dir.