Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
794 views
in Technique[技术] by (71.8m points)

objective c - Debugging Quicklook Plugin in Xcode 4.6

I am trying to debug a quicklook plugin in Xcode 4.6. I have created the executable in Edit Scheme.

Now, when i build the project the plugin is not installed to the "/Library/Quicklook" path. Rather i didn't find it anywhere.

I want to run the plugin in debug mode and want to hit the breakpoints so that i can figure out where the plugin crashes on different files.

It would be great if someone share his knowledge. Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can use brake points and NSLog function for debugging QL plugin. But first you need to configure environment.

  • Select your project on Project Navigator
  • Then select QL plugin target
  • Go to 'Build Phases' tab and add new phase 'Copy files'
  • Select 'Absolute Path' on destination drop down menu and set ~/Library/QuickLook as subpath
  • Open terminal and copy qlmanage to your project's root directory with command cp /usr/bin/qlmanage PROJECT_ROOT_DIR
  • Then select menu Product -> Scheme -> Edit Scheme...
  • Select 'Run' on schemes list
  • On info tab select executable drop down menu, then 'Other...' and select qlmanage binary you have copied to project's root directory
  • On arguments tab add row for 'Arguments Passed On Launch' and set value to -p FULL_PATH_TO_FILE_FOR_PREVIEW

After all steps you can run your project and debug your code.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...