iPhone Application works on simulator & when exported to device, but not via cydia - iphone

What I want to do:
Deploy an App to my phone using SCP without a dev license.
What Is Happening:
I can test on simulator and device and the Application works 100%. When I scp the app to the Applications folder on my phone, the icon shows, and the app opens for about a couple of seconds then closes (you don't see anything except a black background).
I tried using ldid to sign it and the main binary is set to 0755 and chown'd to root:wheel.
I have tried various permission situations and the app pretty much does the same thing no matter what.
What is causing this to happen? I know this is possible as EVERYONE who uploads apps to cydia follows this same process.
Thanks in advance.

The compiled binary on the device is an x86 binary, you need a different build for iPhone.

Check the syslog and see what it says when you tap the app icon. If it says "killed", download the ldid package from Cydia and cd to your application folder and sign it with ldid -S binaryname.
Also, are you compiling using the Open Toolchain or Apple's?

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.

Is it possible to install .app files onto the iPhone simulator without source

Is it possible to download and install raw .app files onto the iPhone simulator. I like the functionality of some apps but simply do not have an iPhone. Would it be possible to download the app files and install them onto the simulator?
No. Release builds target ARM processors. The simulator doesn't emulate the CPU, that's why you have to build for it specifically - simulator builds are x86.
Do you mean with the IPA file? Unfortunately with Ad Hoc releases you need to install the provisioning profile that AFAIK won't allow you to install. There may be a hack but without hacking it there is no way to do so.
If the developer is built for simulator arch, then you can run it. By placing the .app file in the following location.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications/
Note: make sure your restarting the simulator to take effect.

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.

xcodebuild install path?

I am developing an iphone app using xcode. I would like to automate the "build and run" process, and so want to know if there is any way to install the built app on simulator or device.
There is xcodebuild install command but i don't know how to set the installation directory DSTROOT to simulator/device. Please help me there.
I have looked through many forums where people suggest just to use xcode GUI to do the stuff, and I do that too, but I would really like to know the command-line way.
Thanks
All you need to do is copy the built .app from wherever XCode puts it to ~/Library/Application Support/iPhone Simulator/User/Applications/[somefolder]/, with a file named [somefolder].sb (alongside the folder, not in it) containing the following:
(version 1)
(debug deny)
(allow default)
Then launch /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator. And select your App. Without Jailbreaking it's NOT possible to install it from outside the GUI.
The install build action for Xcode will only copy the built product to the install path specified in the xcode project.
This is used for frameworks and libraries that need installing after being built so that other apps can link against them from a common location.
I don't think you'll be able to use this build action to automate the Build and Run process - that is going to have to be done manually by each developer. There is no way to push apps onto a device without using Xcode, iTunes or the iPhone Configuration utility. As for the Simulator, it's as woodleader says. But for the device, without jailbreaking and writing your own code, you can't do this.
What you can do is use xcodebuild to generate daily/nightly builds for continuous integration. You can write a script that checks out the source form version control, runs xcodebuild and puts the built product in an easy to reach location. The installtion onto devices will still need to be done manually however.

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.