Debugging Quicklook Plugin in Xcode 4.6

前端 未结 3 1461
被撕碎了的回忆
被撕碎了的回忆 2020-12-15 01:34

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

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-15 02:10

    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.

提交回复
热议问题