1
votes

I have been trying to write a script that builds and deploys a iphone project to the simulator. When I build the project in xcode it works fine, however when I build the project in the command line, it crashes in the simulator.

I am using the following command to build the app.

xcodebuild -project MyAppSourceCode/trunk/MyApp.xcodeproj -target "MyApp" -sdk iphonesimulator4.3

The build proces completes without errors. The simulator is running sdk4.3. I can build the app in xcode then manually replace the .app file in the simulator directory and it still crashes. This is a cocos2d app. Any suggestions?

EDIT:

I deployed the app in the simulator by first trying the "iphonesim" program described here: How do you deploy an iPhone app to the simulator from the command line?

Second, I tried the simulator command for launching the app without copying it to the simulator directory: ~/../../Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication ~/MyAppSourceCode/trunk/build/Release-iphoneos/MyApp.app/MyApp

This method results in the simulator launching then displaying a pop up message that says: "The simulated application quit."

When that didn't work I wrote a script that copies the MyApp.app to the simulator directory. After you copy the MyApp.app into the simulator directory, you can launch it from the simulator, but it crashes immediately after launch.

1
Could you give some more info as to how are you installing the app on simulator, and how is it crashing?Sailesh
Check your Mac's "Console" Application for crash information under User Diagnostic ReportsBlitz
@Sailesh - I just edited the post with more information. Sorry for the late response, I have been away from my mac for a while.Chris Gonzales
if i build it using to xcodebuild command line, the replace the .app built with xcode with the one built with the command line, it crashes; in most environments, the ide would wrap around the command line compiler, is this true for xcode? does xcode even use xcodebuild?Chris Gonzales

1 Answers

0
votes

Take note that by default command line builds with xcodebuild use the RELEASE configuration. In Xcode the default is DEBUG.

That means you may have a crash bug that only occurs in release builds. To verify try running the app within Xcode in the release configuration by modifying the scheme to build the release configuration.