Escape From Alcatraz: The Brave New World of Xcode Extensions - Pragma Conference Verona, October 2016

Escape From Alcatraz: The Brave New World of Xcode Extensions - Pragma Conference Verona, October 2016

Video:
https://www.youtube.com/watch?v=0oizSiHeaGk

My talk/rant about Xcode Extensions, updated and given at #pragma Conference in Verona, Italy, October 2016.

Sample code: https://github.com/designatednerd/Xcode8ExtensionExample

Abstract:
Every iOS developer wants to tweak Xcode to get it to do exactly what they want it to do. For the last couple of years, a whole ecosystem of plugins grew around a package manager called Alcatraz. But In Xcode 8, Apple dropped the hammer on the undocumented plugin architecture. In its place, they've introduced Xcode Extensions: An official, documented way to start to make Xcode do what you want. Ellen will discuss the history and future of what can be done with these extensions, and walk through an example of creating one.

C4861b1dfdf3bbb21faec4a1acdf183d?s=128

Ellen Shapiro

October 14, 2016
Tweet

Transcript

  1. ESCAPE FROM ALCATRAZ THE BRAVE NEW WORLD OF XCODE EXTENSIONS

    BY ELLEN SHAPIRO #PRAGMA CONF | VERONA, ITALIA | OCTOBER 2016 DESIGNATEDNERD.COM | SPOTHERO.COM | JUSTHUM.COM | @DESIGNATEDNERD
  2. XCODE IS MY FRENEMY

  3. None
  4. None
  5. None
  6. None
  7. None
  8. None
  9. None
  10. None
  11. None
  12. XCODE AUTO-BASHER

  13. XCODE GHOST !

  14. None
  15. None
  16. None
  17. EXTENSIONS!

  18. EXTENSION GOOD NEWS

  19. OFFICIALLY SUPPORTED

  20. None
  21. DOCUMENTED API

  22. None
  23. None
  24. None
  25. MAKING AN EXTENSION

  26. 1. MAKE A HOST MAC APP

  27. 2. ADD AN EXTENSION

  28. None
  29. None
  30. None
  31. XCSourceEditorExtension

  32. XCSourceEditorCommand

  33. 3. PREPARE FOR LAUNCH

  34. sudo /usr/libexec/xpccachectl THEN TURN IT OFF AND ON AGAIN (ONLY

    ON 10.11 EL CAPITAN, NOT NEEDED ON 10.12 SIERRA)
  35. None
  36. None
  37. None
  38. TEMPTING THE DEMO GODS https://github.com/designatednerd/Xcode8ExtensionExample

  39. DISTRIBUTION: LIKE ANY OTHER MAC APP

  40. EXTENSION LIMITATIONS (ON A SCALE OF ! TO ")

  41. !: EXTENSIONS ARE SANDBOXED AND CODE-SIGNED

  42. !: NO DEFAULT KEY BINDINGS (USERS HAVE TO SET THEM

    UP INDIVIDUALLY)
  43. ☹: MUST BE INVOKED BY THE USER

  44. !: NO USER INTERFACE

  45. !: NO ACCESS TO FILE OR PROJECT STRUCTURE

  46. !: CAN'T EMIT WARNINGS

  47. DUMB THINGS I DID WHICH YOU SHOULD NOT DO

  48. FORGOT TO UNINSTALL OLD PLUGIN TOOLS

  49. None
  50. None
  51. None
  52. FORGOT TO ENABLE CODE SIGNING

  53. LAUNCHED THE WRONG VERSION OF XCODE

  54. None
  55. None
  56. None
  57. YOU CAN AVOID THIS ENTIRELY

  58. None
  59. None
  60. None
  61. None
  62. None
  63. None
  64. None
  65. MINI DEMO

  66. OBLIGATORY SUMMARY SLIDE! ▸ Alcatraz is dead in Xcode 8.

    RIP. ▸ Xcode extensions are officially supported, and that's good. ▸ Xcode extensions must have a host macOS app, but that app doesn't actually have to do anything. ▸ Xcode extensions are pretty limited. File radars.
  67. CODE! https://github.com/designatednerd/ Xcode8ExtensionExampl

  68. VIDEOS! ▸ WWDC 2016 Session 414: Using and extending the

    Xcode Source Editor: https://developer.apple.com/videos/play/wwdc2016/414/ ▸ Daniel Jalkut at try! Swift NYC: https://realm.io/news/jalkut- extending-xcode-8/ ▸ Sam Davies for RayWenderlich.com [paid]: https:// videos.raywenderlich.com/screencasts/ios-10-creating-an-xcode-8- extension
  69. QUICK OVERVIEWS FOR PEOPLE WHO PREFER TO READ! ▸ http://www.russbishop.net/xcode-extensions

    ▸ https://littlebitesofcocoa.com/239-creating-an-xcode-source- editor-extension ▸ http://allblue.me/xcode/2016/06/28/Build-your-own-Xcode-8- source-editor-extension/
  70. LINKS! ▸ Roundup of extensions as of mid-August 2016: https://

    theswiftdev.com/2016/08/17/xcode-8-extensions/ ▸ MMWormhole: https://github.com/mutualmobile/MMWormhole
  71. ! SLIGHTLY TERRIFYING LINKS! ! ▸ Xcode Ghost details: https://en.wikipedia.org/wiki/XcodeGhost

    ▸ Strawhorse leaked document: https://theintercept.com/document/ 2015/03/10/strawhorse-attacking-macos-ios-software- development-kit ▸ Strawhorse Context: https://theintercept.com/2015/03/10/ispy- cia-campaign-steal-apples-secrets/
  72. RADARS TO DUPE! If you'd like any of this functionality,

    please dupe these radars: ▸ Allow callbacks anytime a file with a given extension is edited: http://www.openradar.me/26823522 ▸ No Default key bindings: http://www.openradar.me/28170032 ▸ Can't emit warnings: http://www.openradar.me/28170362