[TIMOB-12822] iOS: Simulator appears then exits
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-05-17T22:08:07.000+0000 |
Affected Version/s | Release 3.0.0, Release 3.0.2 |
Fix Version/s | 2013 Sprint 10 API, 2013 Sprint 10, Release 3.1.1, Release 3.2.0 |
Components | iOS |
Labels | qe-closed-3.1.1, triage |
Reporter | Susan Crayne |
Assignee | Sabil Rahim |
Created | 2013-01-04T10:55:39.000+0000 |
Updated | 2013-05-20T17:40:39.000+0000 |
Description
*Problem description*
Run app, iOS simulator appears then exits with the error below.
*Workaround*
"iOS Simulator -> Reset Content and Settings...", or manually delete app from simulator.
*Part log (3.0.2 GA)*
[ERROR] : An error occurred running the iOS Simulator
[ERROR] : [DEBUG] Sessiocould not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 "iOS Simulator failed to install the application." UserInfo=0x101885f90 {NSLocalizedDescription=iOS Simulator failed to install the application., DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}
*Part log (old)*
[DEBUG] Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Simulator session timed out." UserInfo=0x10013bea0 {NSLocalizedDescription=Simulator session timed out.}
*Full log (old)*
INFO] One moment, building ...
[DEBUG] Detecting modules in /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/modules
[DEBUG] Detecting modules in /Library/Application Support/Titanium/modules
[DEBUG] Detected module for android: ti.cloudpush 2.0.7 @ /Library/Application Support/Titanium/modules/android/ti.cloudpush/2.0.7
[DEBUG] Detected module for android: ti.cloudpush 2.0.5 @ /Library/Application Support/Titanium/modules/android/ti.cloudpush/2.0.5
[DEBUG] Detected module for android: ti.cloudpush 2.0.1 @ /Library/Application Support/Titanium/modules/android/ti.cloudpush/2.0.1
[DEBUG] Detected module for commonjs: ti.cloud 2.3.0 @ /Library/Application Support/Titanium/modules/commonjs/ti.cloud/2.3.0
[DEBUG] Detected module for commonjs: ti.cloud 2.1.0 @ /Library/Application Support/Titanium/modules/commonjs/ti.cloud/2.1.0
[DEBUG] Detected module for commonjs: ti.cloud 2.0.5 @ /Library/Application Support/Titanium/modules/commonjs/ti.cloud/2.0.5
[DEBUG] Detected module for commonjs: ti.cloud 2.0.1 @ /Library/Application Support/Titanium/modules/commonjs/ti.cloud/2.0.1
[DEBUG] Looking for Titanium Module id: ti.cloud, version: 2.3.0, platform: commonjs
[INFO] Titanium SDK version: 3.0.0 (12/12/12 18:49 a5894b3)
[INFO] iPhone Device family: universal
[INFO] iPhone SDK version: 6.0
[INFO] iPhone simulated device: iphone
[DEBUG] linking: /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/Resources/app.js to /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/build/iphone/build/Debug-iphonesimulator/IOS6test.app/app.js
[DEBUG] linking: /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/Resources/KS_nav_ui.png to /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/build/iphone/build/Debug-iphonesimulator/IOS6test.app/KS_nav_ui.png
[DEBUG] linking: /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/Resources/KS_nav_views.png to /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/build/iphone/build/Debug-iphonesimulator/IOS6test.app/KS_nav_views.png
[DEBUG] linking: /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/Resources/iphone/appicon.png to /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/build/iphone/build/Debug-iphonesimulator/IOS6test.app/appicon.png
[DEBUG] linking: /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/Resources/iphone/Default-568h@2x.png to /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/build/iphone/build/Debug-iphonesimulator/IOS6test.app/Default-568h@2x.png
[DEBUG] linking: /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/Resources/iphone/Default-Landscape.png to /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/build/iphone/build/Debug-iphonesimulator/IOS6test.app/Default-Landscape.png
[DEBUG] linking: /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/Resources/iphone/Default-Portrait.png to /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/build/iphone/build/Debug-iphonesimulator/IOS6test.app/Default-Portrait.png
[DEBUG] linking: /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/Resources/iphone/Default.png to /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/build/iphone/build/Debug-iphonesimulator/IOS6test.app/Default.png
[DEBUG] linking: /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/Resources/iphone/Default@2x.png to /Users/susancrayne/Documents/Titanium Studio Workspace/IOS6test/build/iphone/build/Debug-iphonesimulator/IOS6test.app/Default@2x.png
[INFO] Minimum iOS version: 4.3 Linked iOS Version 6.0
[DEBUG] executing command: /usr/bin/killall ios-sim
[DEBUG] No matching processes belonging to you were found
[DEBUG] executing command: /usr/bin/killall iPhone Simulator
[DEBUG] No matching processes belonging to you were found
[DEBUG] finding old log files
[INFO] Launching application in Simulator
[INFO] Launched application in Simulator (88.61 seconds)
[INFO] Application has exited from Simulator
[DEBUG] Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Simulator session timed out." UserInfo=0x10013bea0 {NSLocalizedDescription=Simulator session timed out.}
Attachments
File | Date | Size |
---|---|---|
app.js | 2013-01-04T10:55:39.000+0000 | 1339 |
tiapp.xml | 2013-01-04T11:00:06.000+0000 | 2554 |
The only way I can reliably run an app is to manually run the IOS Simulator, Reset Contents and Settings, then run the app.
I also ran into this, so I know that feel. But it works for me now. What Xcode version are you using, and is there any reason you can't update your Studio to 3.0?
The XCode version is 4.5.2 (4G2008a). I updated Studio to Titanium Studio, build: 3.0.1.201212181159 Build: jenkins-titanium-rcp-master-350 (origin/master) Date: 18 December 2012, 12:04:42 Error message is:
After cleaning the project, the simulator consistently appears and does not exit.
TIMOB-13103 - CLI: Intermittent simulator failure I cannot reproduce this issue. Tested with: Titanium Studio, build: 3.1.0.201303141941 Titanium SDK, build: 3.1.0.v20130318141656 CLI 3.0.25 iPhone 6.1 simulator
I ran in to this issue again with: Titanium Studio, build: 3.1.0.201303182358 Titanium SDK, build: 3.1.0.v20130319125050 CLI 3.0.25 Test steps: 1. Created project and ran on simulator (1st attempt)- succeeded 2. Changed app name in tiapp.xml, cleaned the project and tried to run as simulator (2nd attempt)- failed 3. Repeated step 3-failed Note: I noticed this issue occurs consistently if the app's name changed in tiapp.xml It does not matter if the build folder is deleted and the project is cleaned. [ERROR] : An error occurred running the iOS Simulator [ERROR] : [DEBUG] Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 "iOS Simulator failed to install the application." UserInfo=0x7fcbbb871990 {NSLocalizedDescription=iOS Simulator failed to install the application., DTiPhoneSimulatorUnderlyingErrorCodeKey=-1} [ERROR] : [ERROR] : Project failed to build after 17s 790ms
The problem is in ios-sim. It is hard-coded (!) to timeout at 30s. The following procedure unceremoniously pilfered and slightly modified from an enterprising young patch of about 12 days in age to the phone gap branch of the ios-sim fixes the problem. Steps: 1. git clone https://github.com/appcelerator/ios-sim.git 2. Apply this patch (I do not see an attachment button for comments in Ira):
3. rake install from the ios-sim root dir which creates an "ios-sim/build/Release/" 4. mv "/Library/Application Support/Titanium/mobilesdk/osx/3.0.2.GA/iphone/ios-sim" "/Library/Application Support/Titanium/mobilesdk/osx/3.0.2.GA/iphone/ios-sim.old" 5. cp "ios-sim/build/Release/ios-sim" "/Library/Application Support/Titanium/mobilesdk/osx/3.0.2.GA/iphone" 6. Last but not least, for a 5 minute simulator timeout, apply the patch below to the file: "/Library/Application Support/Titanium/mobilesdk/osx/3.0.2.GA/iphone/cli/hooks/run.js" Hopefully you don't need that much time, but it sure does suck to wait 4:59 only to have the simulator exit out on you, doesn't it? I feel your pain - I've recently been forced to make Titanium run in a VM configuration that violates virtually every related TOS on a somewhat underpowered laptop.
Rgds....Matt
Nice, thanks Matt! This issue has been driving me crazy for months :)
My pleasure, I just noticed that the patch I posted in was messed up in the code block of the comment - please check this one out instead - I just edited it.
When I apply this patch, I get this error message: corrupt patch at line 56
Hi Susan, you tried the patch from the directory containing (above) the ios-sim directory? I'm on linux, and utilize diff to create the patch, so I patch using patch like this: patch < ios-sim.patch Not sure if our tools are different. It could also be that my version of ios-sim's iPhoneSimulator.m is different for some reason? I don't have the VM fired up at the moment so I can't take a look right now, but if our versions are different then it may be required to go through line by line and apply the patch manually, if memory serves I was on 3.0.2GA? Edit: yes just looked at my own comments - I was on 3.0.2GA, so that might be important. here's a link to the phonegap branch of ios-sim with their solution from which I worked to apply to the appcelerator version of ios-sim: https://github.com/phonegap/ios-sim/commit/ef30c400c732b73451c7683df1a8088167ae3a24 Oh one other thing to check might be line-endings? Make sure there are no ^M's in there - if for example you pulled the patch down to windows then scp'd it over to a linux system and then applied the patch, the windows system may have applied its crlf garbage, you can use the vi %s/^M//g to remove (ctrl-v ctrl-m gives you the ^M in vi).
I am running 3.1.0GA. Also this direcotry is in /Users/susancrayne/Library/Application Support/Titanium/mobilesdk/osx, not in /Library/Application Support/Titanium/mobilesdk/osx. Does this mean I need to apply the patch manually? I'm pretty sure I can't install an earlier version.
Our location difference shouldn't matter to patch as long as the path from that location to the source is the same. I think the best path forward just to avoid any issues is to apply manually - if there is a C developer nearby grab them for help - tell them its 5 minutes and you'll reward them with something sugary, a donut for example - we tend to be pretty simple creatures and are easily motivated by sweet things (half before the work starts, and they only get the other half when its done). Or give it a go yourself if your developers are suffering from rather extreme anti-social personality disorder - a common affliction among us. Here's how: the patch provides the line numbers and a few lines above and below for matching. Each section of change is divided by lines that look like so: "@@ -187,6 +188,7 @@", the first set of numbers (-187,6) means go to the first file (the original) and put your cursor on line 187, the rest of what you see is continuing for 6 lines. The second set of numbers (+188,7) means in another editor, opened with a copy of the file (this is the one that will become the newly patched file - where you make your changes), go to line 187 and take a look at the next 6 lines also (you can deduce that you're about to add a line, because 6+1=7, but you'll see that extra line in the patch prepended with the "+" sign, so no real need to bother with the number after the comma in each set of numbers between the "@@..@@" signs). So now you are in the right place in both files. Note that there are not necessarily 6 or 7 lines of change, but that's what the patch is showing you below the @@...@@ line to the next @@...@@ line. Between the "@@...@@" lines, the + lines are for lines that were added to the original file to get to the new file, - lines are for those that were removed from the original to get to the new one and lines with no + or - are lines aren't to be changed but just used for context around what has changed so you can get a sense of whether the change is right or not - really just a visual indicator of "Oh yeah, I'm doing the right thing here" or not. Anyway hope that helps!
Thanks for the info. I've done development in C; I can apply the patch.
Great! Well I can't seem to get a JIRA comment to look right to save my life so if you get a ton of emails, I apologize for all of the edits!!
Tested with: Appcelerator Studio, build: 3.1.1.201305181057 SDK, build: 3.1.1.v20130517185716 iOS 6.0 simulator(retina/non_retina), 6.1, 5.1 Test steps: Create a project Run as iOS 6.0 simulator (either retina or non_retina), 6.1;5.1 Actual result: Simulator launches successfully