1

I'm trying to simulate touch in iOS. There some pointers in SO suggest that I could try GraphicsServices/GSEvent.h in the private framework. However, when I followed the steps here, I got these errors:

    Undefined symbols for architecture armv7:
    "_GSCopyPurpleNamedPort", referenced from:
    -[TestGraphicsServicesAppDelegate application:didFinishLaunchingWithOptions:] in TestGraphicsServicesAppDelegate.o
    "_GSSendEvent", referenced from:
    -[TestGraphicsServicesAppDelegate application:didFinishLaunchingWithOptions:] in TestGraphicsServicesAppDelegate.o
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any suggestion? Thanks

edit: the code I used is from Using GraphicsServices.h/GSEvent as well as compiling CLI iPhone tools with Xcode.

Looks like the errors are from this line.

    mach_port_t thePortOfApp = GSCopyPurpleNamedPort...
    GSSendEvent(&record, thePortOfApp);
Community
  • 1
  • 1
pt2121
  • 11,720
  • 8
  • 52
  • 69
  • What's the code where you want to simulate a touch event? – ott-- Dec 28 '12 at 22:16
  • I followed the suggestion on the answer of this post: http://stackoverflow.com/questions/3017367/using-graphicsservices-h-gsevent-as-well-as-compiling-cli-iphone-tools-with-xcod – pt2121 Dec 28 '12 at 22:21
  • Have you added the GS framework to your app? Is that the only occasion you use a GS method? Maybe you simply use `sendActionsForControlEvents:` instead? – ott-- Dec 29 '12 at 17:37

1 Answers1

0

OK, I think I made some mistakes when I added the framework. Somehow I got my project working now.

The errors have gone away after I did a couple things. In Build Setting, I changed Always Search User Paths to Yes. Added the path to the private header in User Header Search Paths. Also, in Build Phrases tab, I add the GraphicsServices in the Link Binary with Libraries section.

Now I can do simple stuff like GSEventLockDevice() and simulating pressing home button. Still have no clue about touch.

pt2121
  • 11,720
  • 8
  • 52
  • 69