简单快速集成Reveal到Xcode,无需导入framework

转自Reveal官网

This method will only work for apps running in the iOS or tvOS Simulator.

Loading Reveal without changing your Xcode project is a great way to let you introspect any project you happen to be working on without needing to change anything. It also means you don't need to worry about accidentally shipping a release build of your app linked with the Reveal library.

1,Open your iOS or tvOS project in Xcode, and select View → Navigators → Show Breakpoint Navigator.
2,In the bottom left of the pane, click the + button and select Add Symbolic Breakpoint.

Paste_Image.png

3,Enter "UIApplicationMain" into the **Symbol **field.
4,Click the **Add Action ** button, and ensure that **Action **is set to Debugger Command.

Paste_Image.png

5,Copy and paste the following text into the field below:
For iOS targets:

expr (Class)NSClassFromString(@"IBARevealLoader") == nil ? (void *)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2) : ((void*)0)

For tvOS targets:

expr (Class)NSClassFromString(@"IBARevealLoader") == nil ? (void *)dlopen("/Applications/Reveal.app/Contents/SharedSupport/tvOS-Libraries/libReveal-tvOS.dylib", 0x2) : ((void*)0)

Note: If necessary, update the path to Reveal.app above to the correct location for your Mac.

6,Check Automatically continue after evaluating actions.

7,Right click the newly created breakpoint and select Move Breakpoint To → User.

Paste_Image.png

You can enable and disable the breakpoint as you would any other. User breakpoints are available across all Xcode projects.

8,In Xcode, build and run your application under the iOS or tvOS Simulator.

Paste_Image.png

If everything worked, you should be able to switch to Reveal and see your iOS or tvOS application listed in the app selector pull-down. Select your app and verify that you can see a snapshot of the app matching what you see in the simulator.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容