耷拉的近义词是什么| 跳什么舞减肥最快| 荡气回肠是什么意思| 什么白酒好喝| 谅解什么意思| 夜尿多吃什么药| 炸东西用什么淀粉| 什么叫多重耐药菌| 口臭是什么原因| 高铁与动车的区别是什么| 手蜕皮什么原因| 姨妈是什么| 属鸡女和什么属相最配| 什么是腹式呼吸| 悲智双运什么意思| 诺如病毒感染吃什么药| 膝关节积液吃什么药| 性瘾是什么意思| 肾素高说明什么| 牙囊肿是什么病严重吗| 为什么会射精| 工口什么意思| 内秀是什么意思| 什么运动长高最快| 终止是什么意思| 12月26日什么星座| 人皇是什么意思| 三大产能营养素是什么| 精炼植物油是什么油| 山豆念什么| 立本是什么意思| 什么是it行业| 否命题和命题的否定有什么区别| 肺部真菌感染用什么药最好| 母亲节是什么时候| 湿气重喝什么茶| 单剂量给药是什么意思| o型血和b型血的孩子是什么血型| 老好人是什么意思| 热得什么填空| 戊型肝炎是什么病| 跳脱是什么意思| 五月二十二是什么星座| 中药什么时候吃最好| cj什么意思| 成都有什么特产| 9月14是什么星座| 红酒是什么味道| 灰指甲用什么药治疗| 高原反应什么症状| 真菌菌丝阳性什么意思| 腱鞘囊肿挂什么科| 爱吃酸的人是什么体质| 转卖是什么意思| 肾虚吃什么补| 广西古代叫什么| 督察是什么级别| 阴道骚痒是什么原因| 一直放屁是什么原因| 备孕前需要做什么检查| 小麦肤色是什么颜色| 屌丝是什么| 坐骨神经痛是什么原因引起的| 回不到我们的从前是什么歌| 精分是什么意思| 雪花秀属于什么档次| 尼维达手表什么档次| 耳仓为什么是臭的| hj是什么意思| 螺内酯片治什么病| 什么是梦魇| 是什么星座| 广州和广东有什么区别| 欲钱知吃月饼是什么生肖| 儿童回春颗粒主要治什么| George是什么意思| 卟是什么意思| 阑尾炎做什么检查| 叶酸什么时候吃| 626什么意思| 捏捏是什么意思| 什么牌子的益生菌调理肠胃比较好| chd是什么意思| 门诊号是什么意思| ipv是什么疫苗| 有机食品什么意思| 胸部胀痛什么原因| 行是什么意思| 西门子洗衣机不脱水是什么原因| 北肖指什么生肖| 粉是什么做的| 芦荟胶有什么作用| 正能量是什么意思| 大拇指有黑色竖纹是什么原因| 无花果是什么季节的水果| 什么人靠别人的脑袋生活| 穿刺活检是什么意思| 阴毛有什么作用| 消炎药有什么| 什么是化学| 龟头瘙痒是什么原因| 高血压挂什么科室| 区委书记属于什么级别| 痤疮是什么原因引起的| brush什么意思| cdg是什么牌子| 贪是什么意思| 奇门遁甲什么意思| 这个季节有什么水果| 孕吐什么时候结束| 星星为什么会眨眼睛| cocoon是什么品牌| 淋巴结肿大是什么样子| 梦见自己坐车是什么意思| 孕妇感冒可以吃什么感冒药| 乳房皮肤痒是什么原因| 什么叫收缩压和舒张压| hib是什么疫苗| 梦见朋友结婚是什么意思| 去香港澳门旅游需要准备什么| 赞聊是什么意思| 胃酸是什么原因| 1951年属什么| 现在有什么好的创业项目| 伤口不容易愈合是什么原因| 小别胜新婚是什么意思| 2d是什么意思| 哺乳期可以吃什么感冒药| 咏柳是什么意思| 天然气是什么气体| 黎明是什么时间| hpf是什么意思| 尖锐湿疣用什么药| 什么地流着| 92年五行属什么| 趁什么不什么| 荷叶茶有什么功效| 胶原蛋白什么时候喝最好| 女人梦见蜈蚣预兆什么| 血脂稠喝什么茶效果好| 心静自然凉是什么意思| 粥样动脉硬化吃什么药| 龙蛇混杂是什么意思| 什么是钙化| 制加手念什么| 痣长在什么地方不好| 花洒不出水什么原因| dior是什么牌子| 菠菜什么时候种最合适| 肠憩室是什么意思| 足银999是什么意思| 三言两语是什么生肖| 1900年属什么生肖| 舅子是什么意思| 小孩子拉肚子吃什么药| 梦见摘桃子是什么意思| 引狼入室是什么意思| 不粘锅涂层是什么材料| 手术前吃什么补充营养| 97年属什么生肖| 米粉和米线有什么区别| 身份证号最后一位代表什么| 男性下体瘙痒用什么药| 喝咖啡有什么好处和坏处| 大姨妈发黑是什么原因| 龙和什么生肖相冲| 小猫能吃什么水果| 治前列腺炎吃什么药效果最好| 氧分压高是什么原因| 人参和什么泡酒壮阳| 斑鸠是什么| 偷鸡不成蚀把米是什么意思| 肌肉的作用是什么| 6月26号是什么星座| 吃什么水果最好| 荔枝为什么上火| 衣原体感染有什么症状| 什么人不适合喝咖啡| 什么样的人不适合吃人参| 楷字五行属什么| 尿液发白是什么原因| 42是什么生肖| 什么是肠镜检查| 虔婆是什么意思| 蜻蜓像什么| 月经发黑是什么原因| 经期吃什么好排除瘀血| 盖碗适合泡什么茶| 丙肝病毒抗体阴性是什么意思| 游弋是什么意思| 91网站是什么| 鼠入牛角是什么动物| 怀孕血糖高有什么症状| 白细胞偏低是什么原因| 什么水果有助于减肥| 喉咙痰多吃什么药最好| 睫毛炎有什么症状| 黄疸是什么原因引起的| 什么叫信仰| 血红蛋白是什么意思| 孕妇适合喝什么牛奶| 孙权与孙策是什么关系| 荨麻疹用什么药膏| 膀胱壁毛糙是什么原因| 关节炎看什么科| 吃维生素c有什么好处| 右侧卵巢多囊样改变是什么意思| 检查食道挂什么科| 什么工作好| 圣女果是什么| 彼此彼此什么意思| 碳13是检查什么的| 氨气是什么味道| 化疗恶心吃什么可以缓解| package什么意思| 斯里兰卡说什么语言| 巴基斯坦讲什么语言| 525什么星座| 拉肚子吃什么药好| 长期口臭要看什么科| 口干口苦是什么原因引起的| 喝可乐有什么危害| 尿频是什么原因| 腰疼是什么原因引起的女性| 刺猬的刺有什么作用| 送女生什么生日礼物比较好| 月经一个月来两次什么原因| 左肾结晶是什么意思| 蓝色药片是什么药| 寄生虫长什么样| 去医院看膝盖挂什么科| 白醋有什么作用| 一个日一个处一个口念什么| 为什么会长息肉| 石榴是什么生肖| single是什么意思| 温水煮青蛙什么意思| 老年人吃什么钙片补钙好| 梦见怀孕的女人是什么意思| 糖醋里脊是什么肉做的| 胆固醇是什么东西| 绿豆可以和什么一起煮| 金字旁目字读什么| 勿误是什么意思| 口苦什么原因| 总价包干是什么意思| 冰室是什么意思| 伪骨科是什么意思| 缺什么补什么| 冬菜是什么菜| 活佛是什么意思呀| 貌不惊人是什么意思| epa和dha是什么| 什么血型招蚊子叮咬| 眼压高是什么原因| 辅助什么意思| 阴囊炎用什么药治疗| 脑梗什么意思| 斑鸠吃什么食物| 睡觉醒来口苦是什么原因| 胃疼是什么感觉| 前是什么偏旁| 不知道干什么| 李子什么季节成熟| 百度

View in English

  • Global Nav Open Menu Global Nav Close Menu
  • Apple Developer
Search
Cancel
  • Apple Developer
  • News
  • Discover
  • Design
  • Develop
  • Distribute
  • Support
  • Account
Only search within “”

Quick Links

5 Quick Links

Videos

Open Menu Close Menu
  • Collections
  • Topics
  • All Videos
  • About

More Videos

  • About
  • Transcript
  • Code
  • 百度 没坐上第一排,老张只能选了一个中间位置坐下,从包中拿出他前一晚准备好的本和笔,齐齐整整地放在桌子上,等着老师上课,俨然一副小学生的样子。

    Discover how you can easily connect Thunderbolt and USB accessories to iPad with DriverKit. We'll show you how to convert your existing Mac drivers without any code changes, learn how to add real-time audio support with AudioDriverKit, and provide best practices and tips for developing drivers for iPad.

    Resources

    • Communicating between a DriverKit extension and a client app
    • Implementing drivers, system extensions, and kexts
    • System Extensions and DriverKit
      • HD Video
      • SD Video

    Related Videos

    WWDC21

    • Create audio drivers with DriverKit

    WWDC20

    • Modernize PCI and SCSI drivers with DriverKit
  • Search this video…

    ? ? Souvik Banerjee: Hi, and welcome to "Bring your driver to iPad with DriverKit." I'm Souvik, and today I'll discuss several exciting new developments in DriverKit. We're going to discuss three topics today. First, I'll give a brief overview of DriverKit. Then, I'll discuss some updates to AudioDriverKit. And I'll end with how to bring your drivers to the iPad Let's get started with an overview. In 2019, we introduced DriverKit, a replacement for IOKit device drivers. DriverKit brought a new way to extend the system that is more reliable and secure, running in userspace. And it's easier to develop since your process isn't in the kernel. These driver extensions, also known as dexts, are bundled in apps, and you can easily distribute your apps and drivers on the Mac App Store. People can easily find your driver with a search, and if your driver is no longer needed, you can just delete the app to uninstall it. Since introducing DriverKit, we have added support for many new driver families.

    We now support Networking, Block Storage, Serial, Audio, and SCSI controller and peripheral drivers in addition to transports such as USB, PCI, and HID.

    To learn more about the kinds of drivers you can build with DriverKit, please check out the "Create audio drivers with DriverKit" session from WWDC 2021 and the "Modernize PCI and SCSI drivers with DriverKit" session from WWDC 2020. Next, we added several new features in AudioDriverKit recently that I want to highlight. One of these features is real-time operations. We're excited to introduce a new feature in AudioDriverKit allowing you to register a real-time callback. This callback gets invoked every time an IO operation happens. You can use this callback if you need to modify your audio buffers on a real-time thread, such as for signal processing.

    To register a real-time callback in AudioDriverKit, we declare an IOOperationHandler block to set on the IOUserAudioDevice. This block will be called from a real-time context when an IO operation occurs on the IOUserAudioStream buffers for the device.

    Inside the block, we check what the operation is, and we can modify the data as necessary. Finally, we call SetIOOperationHandler to set the block on the audio device. Now let's talk about entitlements. When we introduced AudioDriverKit, you had to use the allow-any-userclient-access entitlement on your driver. In macOS 12.1, we introduced a new entitlement specifically for AudioDriverKit. Please update your audio drivers to use the new audio family entitlement instead of the allow-any-userclient-access entitlement. You can keep the allow-any-userclient-access entitlement if you want any app to be able to communicate with your driver. This new entitlement is public for development, so you can get started using this today without filing a request. In fact, all DriverKit family entitlements are now available to use for development. To request this entitlement for distribution, please visit the System Extension page on developer.apple.com. Now, I'm really excited to tell you about DriverKit on iPad. Professionals are increasingly using iPad to do their best work. But many rely on external hardware that they couldn't use on iPad. So today, we're excited to announce that DriverKit is coming to iPad.

    DriverKit on macOS has made it possible to extend the system in a safe and secure way, and we're bringing that same technology to the iPad. In fact, if you've already created a driver with DriverKit on the Mac, you can bring that exact same driver to the iPad without any changes to your driver. USB, PCI, and Audio will be supported in iPadOS 16. This will enable Thunderbolt audio interfaces on iPad for the first time, and many more devices. This is made possible with the power of the M1 chip. All iPads with M1 will support DriverKit. DriverKit on iPadOS is the same as on macOS. This means that you can build one DriverKit driver and have it work on both platforms, no source changes required. In addition , using the new multiplatform apps feature in Xcode 14, you can easily create a single app target to deliver your driver on both Mac and iPad. For more information about multiplatform apps, please check out the "Use Xcode to develop a multiplatform app" session.

    Xcode also now supports automatic signing of DriverKit drivers. It knows how to handle DriverKit on iPadOS and can provision for both Mac and iPad. You no longer need to configure manual signing for DriverKit drivers. Your iPadOS app and driver can be distributed on the App Store , just like on macOS. This means that you can take advantage of features like in-app purchases and have your driver be easily discoverable by users. Let's see just how easy it is to take an existing macOS driver and app and bring it to iPad. Here, I have an app called DriverKitSampleApp. It has a SwiftUI view with a label and a button allowing the user to install the driver. Our driver is called NullDriver. It prints a message when the driver starts and starts a timer that fires every second and increments a counter called timerCount. To make this an iPad app, all I need to do is select the DriverKitSampleApp target in Xcode...

    And add iPad to Supported Destinations.

    Now I can change my run destination to the iPad I have connected to my Mac.

    Let's try running this on the iPad. Here's our iPad app. We have the label and the button from the view we saw in Xcode. Tapping the Install Dext button takes us to Settings, where we see this new Drivers link. We tap that link, and we see a list of all drivers bundled in this app. We can then enable our Null Driver. So you might have noticed several things in the demo. Our Null Driver is bundled inside our iPadOS app, and it gets automatically discovered by the system after installation. On macOS , you would need to use the SystemExtension framework to prompt the user to install the driver. On iPadOS, there is no SystemExtensions framework.

    Inside Xcode, you can see that our driver is embedded within our app. Since drivers are low-level software and are privileged, they need to be approved by the user before they can run. On macOS, users need to go to the Security & Privacy preferences to allow system extensions. On iPadOS, the driver approvals are in the Settings app. There are two options for driver approvals. If there is at least one app with a driver installed, there will be a menu inside General Settings with a list of all available drivers. Each driver can be toggled on or off. If your app contains a Settings bundle, there will be a Drivers link inside your app's Settings. Your app should prompt the user to enable the driver in Settings. Let's start again with our macOS driver project and see how we can have our app prompt the user to enable the driver in Settings. We start by adding iPad to our supported destinations.

    Our SwiftUI view has a button to install the driver, and our view model has a state machine that interacts with the SystemExtensions framework. Since this project is going to build for both Mac and iPad, we want to keep our Mac view and view model but create a new view that will be used on iPad.

    Then, we can go to Build Phases and Compile sources and change the platform filter for each file to conditionally compile for iOS or macOS.

    Now, let's add a Settings bundle to our app. We're going to use the default example Settings for now, but we can change these later to real Settings that the app can use.

    Now let's check the iOS view we just created. We can copy our macOS view to our iOS view to use as a starting point.

    Our iOS view doesn't use a view model, so we can remove that.

    We also need to change our button action to open our Settings bundle. This will take the user into Settings, so that they can enable the driver.

    Finally, we change the button text to make it clear that the user needs to enable the driver in Settings.

    Let's see this in action. We have the view we designed, and tapping the button takes us to our Settings bundle. Then we go into Drivers and enable the Null Driver.

    It's important to keep in mind that drivers launch on demand. Although we've enabled the driver in Settings, the driver only starts running when the hardware device is plugged in to the iPad. After the driver starts running, I can attach a debugger to it using Xcode wireless debugging. To do that, I go to the Debug menu in Xcode, attach to process, then select the NullDriver process. Once attached, I can set breakpoints or pause execution. Here, I've set a breakpoint in our timer. I'm going to print timerCount to see how many times our timer has been called.

    When you're done debugging, detach from the driver process using the Debug menu in Xcode.

    So now we have a driver. But a driver isn't very useful by itself. It needs to communicate with the rest of the system. Some DriverKit frameworks like AudioDriverKit handle this for you. But if you need to do something more advanced, such as creating a custom control panel app for your hardware, you need to have your app be able to communicate with your driver. This is what user clients allow you to do. They allow you to define your own interface, allowing app and driver communication. Apps use the IOKit.framework to open user clients. For an example of how this works, please see the sample code on developer.apple.com.

    So we know that apps can communicate with drivers. But it's important to keep security in mind. Since drivers are privileged, we don't want to allow every app to communicate with drivers.

    On macOS, the app needs the driverkit userclient-access entitlement, and the value is an array of allowed driver bundle identifiers.

    On iPadOS, we added a new entitlement called Communicates With Drivers. It replaces the macOS user client entitlement. This entitlement grants your app the ability to open user clients to your driver.

    If you want to add the Communicates With Drivers entitlement manually to your app, here's the XML entitlement string.

    We can also add this entitlement from Xcode. In Xcode, we go to Signing and Capabilities, then add a new capability. Then, we can search for "communicates with drivers" and add the capability to our app.

    Another use case for user clients is to allow apps from other developers to interact with your driver. So in this case, suppose you have an app and driver and you want to provide a service to other apps, including those from other developers. DriverKit user clients also support this.

    Each app that needs to communicate with drivers needs the communicates with drivers entitlement. The driver needs the Allow Third Party User Clients entitlement. This allows apps built with a different team identifier to open a user client to the driver. Without this entitlement, only apps from the same team can communicate with the driver. If you want to add the Allow Third Party User Clients entitlement manually to your driver, here's the XML entitlement string.

    Or we can add this capability from Xcode by going into Signing and Capabilities for our driver.

    These new user client entitlements are public for development, which means that you can get started using this today without any approval. To request these entitlements for distribution, please see our developer website. DriverKit drivers also have important implications for app update. Automatic app update ensures users always get the latest version of your app. However, for apps containing drivers, the update process works a little differently. Let's suppose you distribute version 1 of your app on the app store. Then, you install that app along with its bundled driver on your iPad and enable the driver in Settings. When you plug in the hardware device for your driver, the driver starts running, and once the driver starts running, your app can begin communicating with your driver using user clients. Now, suppose you find a bug in your app and you submit version 2 to the App Store. Because of automatic app update, the version 2 app is downloaded and installed on your iPad automatically. The driver approval state is maintained through updates, so you don't need to approve the driver again. However, notice that the hardware is still plugged in, and our version 1 driver is still running. Driver version 2 was downloaded with the app update but does not start running. Since the old driver still continues running, your version 2 app may have to communicate with the version 1 driver.

    When the hardware device is unplugged, the driver stops running, so now driver version 1 is done and we can update the driver to version 2.

    Now, if you plug in the device again, we start the version 2 driver, and now your app is communicating with the new driver.

    To recap: Apps are updated anytime with automatic app update. Drivers are updated after the device is unplugged. And your app may communicate with an old driver. When your app and driver are ready, you can submit them to the App Store. Your drivers can only run on devices that support DriverKit. If you want to restrict your app to those devices, such as if your app only installs a driver, add DriverKit to your app's UIRequiredDeviceCapabilities. This will prevent users from installing your app on a device that does not support DriverKit. We also suggest submitting a video to App Review showing how your app and driver work with your hardware device. So that's DriverKit on iPad. You can now bring USB, PCI, and Audio drivers to iPad with M1 and deliver those drivers inside apps on the App Store. And if you already have a driver, it's easy to bring that to iPad. We encourage developers to try using DriverKit on iPad and provide any feedback using Feedback Assistant. Thank you for watching.

    • 2:25 - Register real-time callback in AudioDriverKit

      // Declare a IOOperationHandler block to set on the IOUserAudioDevice.
      // The block will be called from a real time context when a i/o operation
      // occurs on the IOUserAudioStream buffers for the device.
      io_operation = ^kern_return_t(IOUserAudioObjectID in_device,
                                    IOUserAudioIOOperation in_io_operation,
                                    uint32_t in_io_buffer_frame_size,
                                    uint64_t in_sample_time,
                                    uint64_t in_host_time)
      {
          // Add custom code to make modifications to the buffers as necessary
          if (in_io_operation == IOUserAudioIOOperationWriteEnd) {
              ...
          } else if (in_io_operation == IOUserAudioIOOperationBeginRead) {
              ...
          }
          return kIOReturnSuccess;
      };
      this->SetIOOperationHandler(io_operation);

Developer Footer

  • Videos
  • WWDC22
  • Bring your driver to iPad with DriverKit
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • App Extensions
    • App Store
    • Audio & Video
    • Augmented Reality
    • Design
    • Distribution
    • Education
    • Fonts
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning
    • Open Source
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Tutorials
    • Downloads
    • Forums
    • Videos
    Open Menu Close Menu
    • Support Articles
    • Contact Us
    • Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Get the Apple Developer app.
    Copyright ? 2025 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines
    正月二十一是什么星座 顺时针是什么方向 肉便器是什么东西 意淫是什么 活检是什么意思
    老人家脚肿是什么原因引起的 打喷嚏流清鼻涕是什么感冒 k是什么牌子 颈动脉斑块吃什么药 什么时候大阅兵
    梦见死了人是什么征兆 什么叫五官 桥本是什么意思 空腹是什么意思 甲状腺结节吃什么水果好
    阿西吧是什么意思 气虚便秘吃什么中成药 三人死亡属于什么事故 牙周炎挂什么科 翻新机是什么意思
    牙龈萎缩吃什么维生素hcv9jop2ns9r.cn 外阴白斑用什么药hcv8jop2ns3r.cn 羊肉馅饺子配什么菜好hcv8jop4ns1r.cn 海水是什么颜色的hcv9jop5ns3r.cn 手指麻木是什么病的前兆hcv8jop0ns7r.cn
    怕冷不怕热是什么体质hcv8jop9ns7r.cn 晚上睡觉腿抽筋是什么原因hcv7jop9ns4r.cn 桃不能和什么一起吃hcv9jop5ns3r.cn 睡觉张嘴是什么原因hcv8jop7ns3r.cn 男人脖子后面有痣代表什么hcv9jop3ns0r.cn
    肠炎有什么症状hcv9jop0ns1r.cn 苡字五行属什么hcv8jop0ns2r.cn 鸿雁是什么意思hcv8jop3ns9r.cn 什么也别说dayuxmw.com 紫荆花的花语是什么hcv9jop7ns4r.cn
    生姜和红枣煮水喝有什么作用hcv8jop1ns9r.cn 什么的走hcv9jop7ns3r.cn 什么样的鲜花hcv8jop1ns4r.cn 突然视力模糊是什么原因引起的jiuxinfghf.com 书犹药也下一句是什么hcv8jop9ns5r.cn
    百度