经过最近几天的研究,本人已经做出了一套快速入口的小demo,并且可以让模拟器进行3D Touch的快速入口效果.
一: 让模拟器可以测试3D Touch的快速入口效果步骤(本人也是在github上发现的方法,再次总结一下):
模拟器测试3D Touch的方法
1. 打开终端
2. git clone https://github.com/DeskConnect/SBShortcutMenuSimulator.git
3. cd SBShortcutMenuSimulator
4. make
5. 打开写好的程序 运行打开模拟器
6. xcrun simctl spawn booted launchctl debug system/com.apple.SpringBoard --environment DYLD_INSERT_LIBRARIES=$PWD/SBShortcutMenuSimulator.dylib
7. xcrun simctl spawn booted launchctl stop com.apple.SpringBoard 终端运行完这句话模拟器会黑一下 几秒就好了
8. echo 'cn.bobo.shortcut' | nc 127.0.0.1 8000 注意: 'cn.bobo.shortcut' ''里边写的是自己项目的Bundle identifier.
注意: 每次想要启动快速入口都要重复操作第8步.
快速入口两种配置方法: 静态配置和动态配置 静态配置直接在info.plist里边配置就好了 这个示例是动态配置的.