{"action":"closed","issue":{"url":"https://api.github.com/repos/kif-framework/KIF/issues/707","repository_url":"https://api.github.com/repos/kif-framework/KIF","labels_url":"https://api.github.com/repos/kif-framework/KIF/issues/707/labels{/name}","comments_url":"https://api.github.com/repos/kif-framework/KIF/issues/707/comments","events_url":"https://api.github.com/repos/kif-framework/KIF/issues/707/events","html_url":"https://github.com/kif-framework/KIF/issues/707","id":103106604,"node_id":"MDU6SXNzdWUxMDMxMDY2MDQ=","number":707,"title":"UIAutomation Framework does not work with an actual device","user":{"login":"mikelupo","id":8654915,"node_id":"MDQ6VXNlcjg2NTQ5MTU=","avatar_url":"https://avatars2.githubusercontent.com/u/8654915?v=4","gravatar_id":"","url":"https://api.github.com/users/mikelupo","html_url":"https://github.com/mikelupo","followers_url":"https://api.github.com/users/mikelupo/followers","following_url":"https://api.github.com/users/mikelupo/following{/other_user}","gists_url":"https://api.github.com/users/mikelupo/gists{/gist_id}","starred_url":"https://api.github.com/users/mikelupo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikelupo/subscriptions","organizations_url":"https://api.github.com/users/mikelupo/orgs","repos_url":"https://api.github.com/users/mikelupo/repos","events_url":"https://api.github.com/users/mikelupo/events{/privacy}","received_events_url":"https://api.github.com/users/mikelupo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2015-08-25T20:14:07Z","updated_at":"2018-07-04T07:39:38Z","closed_at":"2018-07-04T07:39:38Z","author_association":"CONTRIBUTOR","body":"Creating a new defect per @phatmann and mentioning @joemasilotti per his recommendation.\nAlso this may be historically related to #518 \n\n**The problem:**\nWhen calling any of the UIAutomationHelper class methods the following is seen in the console repeated hundreds of times.\n**UIAutomation is not enabled on this device. UIAutomation must be enabled in Settings.**\n\n**TO REPRODUCE**\nnote: The bug does not occur on the simulator.\n\n1) Clone: git@github.com:mikelupo/KIF.git\n2) Change to branch: reproduce_518\n3) Load the KIF.xcodeproj into XCode 6.4\n4) Connect up your iOS device. (This was reproduced on a REAL iPhone 5s.).\n5) In XCode test navigator, select the BackgroundTests suite of tests and run them.\n6) The Test Host app will load on the device under test and the test will begin.\n7) The test will not deactivate the app, whilst in the console log the message can be seen (hundreds of times): \"Test Host[1179:178394] UIAutomation is not enabled on this device. UIAutomation must be enabled in Settings.\"\n\n**Confirming the device settings:**\n1) Developer > Enable UI Automation turned ON in the device settings.\n2) Running on a Debug build (as opposed to Release).\n3) Building using an Apple developer profile (as opposed to a distribution profile). I can step through code in the debugger as well. If it were a distribution build, debugging would not be possible.\n4) Scheme is set to run in debug. Profiling is also set to debug (as suggested by this Stackoverflow post)\n5) KIF tests are contained in a test target that depends on the app (target) being tested. Both targets are debug.\n\nCuriously...is there anything in the following link that can help us?\nhttps://github.com/TestingWithFrank/PublicAutomation/tree/master/PublicAutomation\n\n**More observations:**\nIt was noticed that in the UIAutomation.framework binary, there is a check to see if UIAutomation is enabled on the device. I surmise that the method call is returning NO. Permission issue?????\n\nint __UIAutomationEnabled() {\nrax = CFPreferencesGetAppBooleanValue(@\"UIAutomationEnabled\", @\"com.apple.UIAutomation\", var_9);\nif (var_9 == 0x0) {\n__UIATargetIsInternal();\nCFPreferencesSetAppValue(@\"UIAutomationEnabled\", *_kCFBooleanTrue, @\"com.apple.UIAutomation\");\nCFPreferencesSynchronize(@\"com.apple.UIAutomation\", *_kCFPreferencesCurrentUser, *_kCFPreferencesAnyHost);\nrax = 0x1;\n}\nrax = rax & 0xff;\nreturn rax;\n}\n\nAlso, the following call:\nCFPreferencesGetAppBooleanValue(CFSTR(\"UIAutomationEnabled\"), CFSTR(\"com.apple.UIAutomation\"), YES);\nreturns NO\n\nCan we somehow override this?\n"}}
{"actor":{"display_login":"justinseanmartin"}}