{"action":"created","issue":{"url":"https://api.github.com/repos/frida/frida-core/issues/73","repository_url":"https://api.github.com/repos/frida/frida-core","labels_url":"https://api.github.com/repos/frida/frida-core/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/frida/frida-core/issues/73/comments","events_url":"https://api.github.com/repos/frida/frida-core/issues/73/events","html_url":"https://github.com/frida/frida-core/pull/73","id":138436738,"number":73,"title":"[iOS][FixBug]: app may be killed by watchdog.","user":{"login":"Proteas","id":936702,"avatar_url":"https://avatars.githubusercontent.com/u/936702?v=3","gravatar_id":"","url":"https://api.github.com/users/Proteas","html_url":"https://github.com/Proteas","followers_url":"https://api.github.com/users/Proteas/followers","following_url":"https://api.github.com/users/Proteas/following{/other_user}","gists_url":"https://api.github.com/users/Proteas/gists{/gist_id}","starred_url":"https://api.github.com/users/Proteas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Proteas/subscriptions","organizations_url":"https://api.github.com/users/Proteas/orgs","repos_url":"https://api.github.com/users/Proteas/repos","events_url":"https://api.github.com/users/Proteas/events{/privacy}","received_events_url":"https://api.github.com/users/Proteas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-04T10:15:25Z","updated_at":"2016-03-04T10:52:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/frida/frida-core/pulls/73","html_url":"https://github.com/frida/frida-core/pull/73","diff_url":"https://github.com/frida/frida-core/pull/73.diff","patch_url":"https://github.com/frida/frida-core/pull/73.patch"},"body":"Issue: app crashed, during \"Instrumenting functions...\"\r\nReason: killed by watchdog\r\nFix: use SBSLaunchApplicationForDebugging to launch app.\r\nNote: my local toolchain is broken, so the code is not tested. please review and test the code first."},"comment":{"url":"https://api.github.com/repos/frida/frida-core/issues/comments/192230386","html_url":"https://github.com/frida/frida-core/pull/73#issuecomment-192230386","issue_url":"https://api.github.com/repos/frida/frida-core/issues/73","id":192230386,"user":{"login":"Proteas","id":936702,"avatar_url":"https://avatars.githubusercontent.com/u/936702?v=3","gravatar_id":"","url":"https://api.github.com/users/Proteas","html_url":"https://github.com/Proteas","followers_url":"https://api.github.com/users/Proteas/followers","following_url":"https://api.github.com/users/Proteas/following{/other_user}","gists_url":"https://api.github.com/users/Proteas/gists{/gist_id}","starred_url":"https://api.github.com/users/Proteas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Proteas/subscriptions","organizations_url":"https://api.github.com/users/Proteas/orgs","repos_url":"https://api.github.com/users/Proteas/repos","events_url":"https://api.github.com/users/Proteas/events{/privacy}","received_events_url":"https://api.github.com/users/Proteas/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T10:52:02Z","updated_at":"2016-03-04T10:52:02Z","body":"this method is not perfect, because some app may not allow to be attached by a debugger.\r\nmaybe should change the timeout value of watchdog, also need to test that the related api is not denied by the Sandbox.\r\ncode snippet:\r\n`BOOL SetWatchDogTimeout(int seconds)\r\n{\r\n    CFMutableDictionaryRef watchDogSrvInfo = NULL;\r\n    watchDogSrvInfo = IOServiceMatching(\"IOWatchDogTimer\");\r\n    if (!watchDogSrvInfo) {\r\n        printf(\"SetWatchDogTimeout: fail to get service info\\n\");\r\n        return NO;\r\n    }\r\n    \r\n    io_service_t watchDogSrv = NULL;\r\n    watchDogSrv = IOServiceGetMatchingService(kIOMasterPortDefault, watchDogSrvInfo);\r\n    if (!watchDogSrvInfo) {\r\n        printf(\"SetWatchDogTimeout: fail to get service\\n\");\r\n        return NO;\r\n    }\r\n    \r\n    CFNumberRef timeout = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &seconds);\r\n    if (!timeout) {\r\n        printf(\"SetWatchDogTimeout: fail to create number object\\n\");\r\n        return NO;\r\n    }\r\n    \r\n    kern_return_t result = KERN_SUCCESS;\r\n    result = IORegistryEntrySetCFProperties(watchDogSrv, timeout);\r\n    \r\n    CFRelease(timeout);\r\n    IOObjectRelease(watchDogSrv);\r\n    \r\n    return (result == KERN_SUCCESS);\r\n}`"}}