{ "id": "138106", "key": "TIMOB-17867", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2020-01-30T09:23:34.000+0000", "created": "2014-10-15T17:37:20.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "42269", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "inwardIssue": { "id": "135999", "key": "TIMOB-17601", "fields": { "summary": "iOS8: Simulator - unexpected behavior before launching the app", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "mdadu", "key": "mdadu", "displayName": "Muhammad Dadu", "active": false, "timeZone": "Europe/London" }, "updated": "2020-01-31T10:45:14.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "After the recent updates to support Xcode 6, NSLog no longer works with ios-sim. The output of logging information is crucial for projects like tiO2 which require log output to see the results of testing.\r\n\r\nThis used to work in iOS 7, but we removed some functionality in this commit (https://github.com/appcelerator/ios-sim/commit/1c01fceb33428259308321989704bd1c790c2cca) because it was causing CPU spikes in iOS 8. Removing this (readInBackgroundAndNotify) fixed the CPU spikes, but it also removed the NSLog functionality on iOS 7. It never appeared to work on iOS 8 simulators.\r\n\r\nWe need to reproduce the CPU spikes and logging failures, and then see what code is required to make NSLog work again.\r\n\r\nThis application can help with testing the functionality: https://github.com/appcelerator/ioslib/tree/master/test/TestApp", "attachment": [], "flagged": false, "summary": "iOS: NSLog Fails on iOS simulators", "creator": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1177, "state": "closed", "name": "2020 Sprint 2", "startDate": "2020-01-20T17:44:37.733Z", "endDate": "2020-01-31T17:44:00.000Z", "completeDate": "2020-01-31T16:57:44.689Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "328224", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "To verify and fix this issue, you first must be able to reproduce the problem. You need Xcode 6, a native iOS app that does an NSLog(), and a simulator's udid.\r\n\r\nRun {{ti info -t ios}} to find iOS Simulator udids. You will want an iOS 8 simulator. I recommend an iPhone 6 simulator.\r\n\r\nNext, build the sample app from https://github.com/appcelerator/ioslib/tree/master/test/TestApp:\r\n\r\n{code}\r\ngit clone https://github.com/appcelerator/ioslib.git\r\ncd ioslib/test/TestApp\r\nxcodebuild clean build -configuration Debug -sdk iphonesimulator8.0 VALID_ARCHS=\"i386\" ARCHS=\"i386\" GCC_PREPROCESSOR_DEFINITIONS=\"TEST_BASIC_LOGGING\"\r\n../../lib/ios-sim launch build/Debug-iphonesimulator/TestApp.app --xcode-dir /Application/Xcode.app/Contents/Developer --udid \r\n{code}\r\n\r\nThis will launch the iOS Simulator and start the TestApp. The app will call NSLog() but there is no output, hence the bug.\r\n\r\nWhat worked for iOS 7 and older is adding the following to the stdioDataIsAvailable() function in ios-sim (https://github.com/appcelerator/ios-sim/blob/master/Source/iPhoneSimulator.m#L337-L351):\r\n\r\n{code}\r\n[[notification object] readInBackgroundAndNotify];\r\n{code}\r\n\r\nThis line fixes NSLog() for iOS 7, but breaks in iOS 8. There is no logging in iOS 8 and the CPU spikes until the app is quit.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-10-15T18:24:38.000+0000", "updated": "2014-10-15T20:09:25.000+0000" }, { "id": "329168", "author": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This might be saying the obvious, but NSLog with Xcode 6 in Obj-C on a iPhone 6 simulator works fine from Xcode.\r\n\r\nThis is really looking like an AppC issue.\r\n\r\nsteps to reproduce:\r\ncreate a new single page ObjC iOS app in Xcode.\r\n\r\nuse the following code:\r\n\r\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\r\n // Override point for customization after application launch.\r\n NSLog(@\"Logging in iOS8 simulators work. Your move Appc\");\r\n return YES;\r\n}\r\n\r\nObserve that it shows up in console in Xcode.", "updateAuthor": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-23T15:06:04.000+0000", "updated": "2014-10-23T15:06:04.000+0000" }, { "id": "329169", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I believe the ticket illustrates the fact that the issue is with ios-sim, which unfortunately has to rely on a private, undocumented framework. Do you have a helpful suggestion as to how to fix ios-sim so that it may work again?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-23T15:12:18.000+0000", "updated": "2014-10-23T15:12:18.000+0000" }, { "id": "329178", "author": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I just created a new titanium app (3.4.0.GA) using Xcode 6 with iOS8 simulator on OSX 10.9.5 ( 6 plus and 4s) and in titanium console.log will print to the console.\r\n\r\nI also just tried to reproduce Chris Barber's steps and I see how that fails.\r\n\r\nHowever, the phonegap fork of ios-sim does not have this problem.\r\naka if you take Chris' test app and use the phonegap fork, you get logging back.\r\n\r\nhttps://github.com/phonegap/ios-sim\r\n\r\n{code}\r\n Debug-iphonesimulator git:(master) ✗ pwd\r\n/Users/andrewmcelroy/Desktop/ioslib/test/TestApp/build/Debug-iphonesimulator\r\n/Users/andrewmcelroy/Desktop/ioslibz/phonegap-ioslib/build/Release/ios-sim launch TestApp.app\r\n2014-10-23 10:55:52.198 TestApp[11931:250282] [INFO] info test\r\n\r\n2014-10-23 10:55:52.199 TestApp[11931:250282] [DEBUG] debug test\r\n2014-10-23 10:55:52.199 TestApp[11931:250282] [DEBUG] line 1 test\r\n[DEBUG] line 2 test\r\n\r\n2014-10-23 10:55:52.199 TestApp[11931:250282] [DEBUG] AUTO_EXIT\r\n{code}\r\n\r\none thing to note, I made one modification to Chris' example app -- I removed the ifdef on TEST_BASIC_LOGGING", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-23T15:58:03.000+0000", "updated": "2014-10-23T16:12:05.000+0000" }, { "id": "329181", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is that perhaps related to commit https://github.com/phonegap/ios-sim/commit/aa583e9fefb6b8b8139da2327c6c3996a0fc6e83?\r\n\r\nNote that they also removed Xcode 5 support, which we can't just yet.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-23T16:11:51.000+0000", "updated": "2014-10-23T16:11:51.000+0000" }, { "id": "453897", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "We no longer use ios-sim to relay log messages.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2020-01-30T09:23:34.000+0000", "updated": "2020-01-30T09:23:34.000+0000" }, { "id": "453965", "author": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "body": "Ticket closed.", "updateAuthor": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "created": "2020-01-31T10:45:09.000+0000", "updated": "2020-01-31T10:45:09.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }