2

When I am writing a tweak application with [[UIATarget localTarget].frontMostApp isVisible] in main.mm main function, I get the exception saying

* exception UIAutomation is not enabled on this device. UIAutomation must be enabled in Settings. *

But I have Enabled Settings->Developer->Enable Automation UI in device. iOS version:8.1.2 and 8.0.1 jail broken.

 int main(int argc, char **argv, char **envp)
{
    @autoreleasepool {

        @try
        {

            [[UIATarget localTarget].frontMostApp isVisible];

            if ([UIATarget localTarget].springboard.pid == nil)
            {
                return 0;
            }
        }
        @catch (NSException *exception)
        {
            NSLog(@"*** exception %@ ***",exception);
            return 0;
        }
    }
}

I have seen this link https://github.com/kif-framework/KIF/issues/707 and some Apple reference documents for UIATarget frontMostApp but I found no solution so far.

Is this problem with the iOS version ? How can I solve this? Any help is appreciated.

Satheesh
  • 10,998
  • 6
  • 50
  • 93
kavitha k
  • 51
  • 4
  • What is a tweak application?? pl provide some more details. – Satheesh Jan 19 '16 at 07:20
  • @satheeshwaran Basically,this tweak application objective is to launch the app and repeat the actions performed on the same app reading a file from particular directory which contains the details of earlier performed actions. – kavitha k Jan 19 '16 at 07:29
  • please provide links for detailing what a tweak application is. – Satheesh Jan 19 '16 at 07:31
  • Do you mean what is tweak?I guess its to deal with UIAutomation.framework – kavitha k Jan 19 '16 at 07:36
  • Hey bascially the question is simple,irrespective of enabling in settings,i get the error "UIAutomation not enabled in device" when i call target.frontMostApp. – kavitha k Jan 19 '16 at 07:38

1 Answers1

1

Your UIAuomation settings plist will be separately created for each application in case of tweaks.

Enable it in /private/var/mobile/Containers/Data/Application/XXXXXXXX-ACAB-4FC9-AE3E-XXXXXX/Library/Preferences/com.apple.UIAutomation.plist and Reboot your device to get rid of this error.

Irshad Mohamed
  • 2,129
  • 1
  • 18
  • 19