Giter Site home page Giter Site logo

didi / dokit Goto Github PK

View Code? Open in Web Editor NEW
20.0K 399.0 3.1K 57.16 MB

一款面向泛前端产品研发全生命周期的效率平台。

License: Apache License 2.0

Ruby 0.10% Objective-C 20.54% Java 51.47% Objective-C++ 0.15% HTML 0.51% JavaScript 2.52% C 0.38% Kotlin 17.46% Shell 0.12% Swift 0.50% Dart 3.25% Vue 2.80% Less 0.01% AIDL 0.01% CMake 0.02% C++ 0.14%
ios tools monitoring performance android mockgps miniapp

dokit's Introduction

简介

DoraemonKit







DoKit诞生于滴滴城运服体验技术部,是一款面向泛前端产品研发全生命周期的效率平台。经过两年的发展,当前DoKit已经发展成了一个相对完整的生态,比如DoKit For Android、DoKit For iOS、DoKit For 小程序、DoKit For Flutter、DoKit For Web。同时我们的项目被BAT以及滴滴、字节、快手、京东等等头部独角兽企业广泛使用并获得良好的口碑。随着dokit.cn平台端的推出,标志着DoKit已经从单纯的效率工具正式进入了效率工具平台的阶段。与此同时我们一直都未停下持续探索的精神,积极地在更多平台领域进行尝试,不给自己设限。我们相信DoKit的未来充满无限可能。

English Readme

领域生态

DoKit 首页效果演示

使用手册

访问DoKit官网,点击"使用中心"。

温馨提示:当前DoKit的所有功能都只针对Debug环境,Release环境未经过实际验证,所以请大家严格按照官方文档来集成,也不建议大家在Release环境上使用DoKit的任何功能。如果大家一定要在Release环境上使用,请自行进行充分的测试和验证,DoKit官方将不承担任何责任和损失。

更新日志

社区活动

DoKit调研问卷 亲爱的DoKit用户,动动你的小手指参与一下我们的官方调研活动吧。我们极度渴望听到你们的声音:

链接:https://page.juyanwenjuan.com/jy_0CMpJzlu.html

DoKit 首页效果演示

开发背景

每一个稍微有点规模的 App,总会自带一些线下的测试功能代码,比如环境切换功能、帧率查看功能等等,这些功能的切换入口往往放在各式各样的入口中,比如一些特殊的手势,双击 statusBar,双击某一个功能区块,或者新建一个 keyWindow 始终至于 App 最上方等等,而且每一个 App 里面的线下附带功能模块很多是相似的,比如帧率查看、内存和 CPU 监控等等,但是现在基本上都是每个 App 都是自己实现了一份,经历了以上的问题之后,DoKit 就有了它存在的意义。

DoKit 是一个功能平台,能够让每一个 App 快速接入一些常用的或者你没有实现的一些辅助开发工具、测试效率工具、视觉辅助工具,而且能够完美在 Doraemon 面板中接入你已经实现的与业务紧密耦合的一些非通有的辅助工具,并搭配我们的dokit平台,让功能得到延伸,接入方便,便于扩展。

简单总结

1、DoKit 能够快速让你的业务测试代码能够在这里统一管理,统一收口;

2、DoKit 内置很多常用的工具,避免重复实现,一次接入,你将会拥有强大的工具集合;

3、搭配dokit平台,借助接口Mock健康体检文件同步助手一机多控让你方便和他人协同,极大的提升研发过程中的效率。

功能模块

一、平台工具(www.dokit.cn)

  1. 【数据Mock】 App接口Mock解决方案,提供一套基于App网络拦截的接口Mock方案,无需修改代码即可完成对于接口数据的Mock。
  2. 【健康体检】 一键式操作,整合DoKit多项工具,数据可视化,快速准确定位问题,让你对app的性能了如指掌。
  3. 【文件同步助手】 通过终端服务,让你的终端空间在平台端完整的展现并提供强大的文件以及数据库操作能力。
  4. 【一机多控】 主从同步,释放人力,让研发测试效率提升看得见

二、常用工具

  1. 【App 信息查看】 快速查看手机信息,App 基础信息、签名相关、权限信息的渠道,避免去手机设置查找或者查看项目源代码的麻烦;
  2. 【开发者选项 Android特有】 一键跳转开发者选项,避免安卓由于平台差异导致的入口不一致
  3. 【本地语言】 一键跳转本地语言,避免安卓由于平台差异导致的入口不一致
  4. 【沙盒浏览】 App 内部文件浏览的功能,支持删除和预览, 并且能通过 AirDrop 或者其他分享方式上传到 PC 中,进行更加细致的操作;
  5. 【MockGPS】 App 能定位到全国各地,支持地图地位和手动输入经纬度;
  6. 【H5任意门】 开发测试同学可以快速输入 H5 页面地址,查看该页面效果;
  7. 【Crash查看】 方便本地打印出出现 Crash 的堆栈;
  8. 【子线程UI】 快速定位哪一些 UI 操作在非主线程中进行渲染,避免不必要的问题;(iOS独有)
  9. 【清除本地数据】 一键删除沙盒中所有数据;
  10. 【NSLog】 把所有 NSLog 信息打印到UI界面,避免没有开发证书无法调试的尴尬;
  11. 【Lumberjack】 每一条 CocoaLumberjack 的日志信息,都在在 App 的界面中显示出来,再也不需要导出日志这么麻烦;(iOS独有)
  12. 【DBView】 通过网页方便快捷的操作应用内数据库,让数据库的调试变得非常优雅;
  13. 【模拟弱网】 限制网速,模拟弱网环境下App的运行情况;(android独有)
  14. 【JS脚本】 在指定WebView运行JS脚本。(iOS独有)

三、性能检测

  1. 【帧率】 App 帧率信息提供波形图查看功能,让帧率监控的趋势更加明显;
  2. 【CPU】 App CPU 使用率信息提供波形图查看功能,让 CPU 监控的趋势更加形象;
  3. 【内存】 App 内存使用量信息提供波形图查看功能,让内存监控的趋势更加鲜明;
  4. 【流量监控】 拦截 App 内部流量信息,提供波形图展示、流量概要展示、流量列表展示、流量筛选、流量详情,对流量信息统一拦截,成为我们 App 中自带的 "Charles";
  5. 【卡顿】 锁定 App 出现卡顿的时刻,打印出对应的代码调用堆栈;
  6. 【大图检测】 通过流量监测,找出所有的大小超标的图片,避免下载大图造成的流量浪费和渲染大图带来的CPU消耗。
  7. 【启动耗时】 无侵入的统计出App启动过程的总共耗时;
  8. 【UI层级检查】 检查出每一个页面中层级最深的元素;
  9. 【函数耗时】 从函数级别分析app性能瓶颈;
  10. 【Load】 找出所有的Load方法,并给出耗时分析;(iOS独有)
  11. 【内存泄漏】 找出App中所有的内存泄漏的问题。

四、视觉工具

  1. 【颜色吸管】 方便设计师 UI 捉虫的时候,查看每一个组件的颜色值是否设置正确;
  2. 【组件检查】 可以抓取任意一个UI控件,查看它们的详细信息,包括控件名称、控件位置、背景色、字体颜色、字体大小;
  3. 【对齐标尺】 参考 Android 系统自带测试工具,能够实时捕获屏幕坐标,并且可以查看组件是否对齐;
  4. 【元素边框线】 绘制出每一个 UI 组件的边框,对于组件布局有一定的参考意义。

五、Weex专项工具(CML专项工具)

  1. 【console日志查看】 方便在端上查看每一个Weex文件中的console日志,提供分级和搜索功能;
  2. 【storage缓存查看】 将Weex中的storage模块的本地缓存数据可视化展示;
  3. 【容器信息】 查看每一个打开的Weex页面的基本信息和性能数据;
  4. 【DevTool】 快速开启Weex DevTool的扫码入口。

tips : 如果使用我们滴滴优秀的开源跨端方案 chameleon 也可以集成该工具集合

六、支持自定义的业务工具集成到面板中

统一维护和管理所有的测试模块,详见接入手册

七、微信小程序专项工具

详见 Doraemon mini program debugger

相关文档

QQ 技术交流群

QQ 交流群


















项目成员

创始人 yixiangboy(易翔) 负责人 小枫

内部核心成员 小枫ChasonTangAdamCaoQAQfangyeqing123RealOnlyoneHeyCFarmeryFeii卡布达maxieezhugeafanti

贡献者榜单 yixiangboy(易翔)jtsky(金台)LinJZongwanglikun7342jayconsciousjellybeanlinusflowwangzhipengBzCoderchangzuozhenmomoxiangbeiwenquanlebaohiXgbChinnkoy644938647wm219goolongmiracle9312lwhsgz123huakuchaHuginChenfeng562925462azhonrex26csc-EricWuxiandanin0xd-cck373379320fabczy500Knight-ZXWboaiklone1127DeveloperLYsagdragonccworld1000HDB-Liyu-jianfengydlsl

如何成为外部贡献者? 提交有意义的PR,并被采纳。

使用提醒

因为SDK目前会配合dokit.cn平台, 会产生一些网络数据,这些信息我们收集绝不用于任何恶意用途。

以下为所有涉及到网络请求的部分

  1. 统计有多少用户集成了dokit

    Android : DoraemonStatisticsUtil#uploadUserInfo

    iOS : DoraemonStatisticsUtil#upLoadUserInfo

  2. 统计每个内置kit的使用情况

    Android : DataPickManager#realPost

    iOS : DoraemonBuriedPointManager#uploadData

  3. 上传健康体检的相关数据

    Android : AppHealthInfoUtil#post

    iOS : DoraemonHealthManager#upLoadData

  4. 数据mock的相关网络请求

    Android : NetWorkMockFragment 里涉及到接口mock的相关网络请求

    iOS : DoraemonMockManager#queryMockData&uploadSaveData

敬请各位用户知晓。

友情链接

  1. Hummer,Hummer 是一套高性能高可用的跨端开发框架,一套代码可以同时支持开发 Android 和 iOS 应用。现已经支持 Vue/TypeScript/JavaScript 三种语法,面向大前端开发人员,总有一款适合你。

  2. Chameleon,简写CML,中文意思变色龙,意味着就像变色龙一样能适应不同环境的跨端整体解决方案,达到真正意义上"一套代码,多端运行"的终极目标

  3. Booster 是一款专门为移动应用设计的易用、轻量级且可扩展的质量优化框架,其目标主要是为了解决随着 APP 复杂度的提升而带来的性能、稳定性、包体积等一系列质量问题。Booster 提供了性能检测、多线程优化、资源索引内联、资源去冗余、资源压缩、系统 Bug 修复等一系列功能模块,可以使得稳定性能够提升 15% ~ 25%,包体积可以减小 1MB ~ 10MB。同时DoKit插件的底层也是基于Booster进行开发的。

  4. AoE,一个终端侧AI集成运行时环境

  5. Mand Mobile 一款优秀的面向金融场景的 移动端UI组件库

  6. 我们团队的技术公众号【滴滴OrangeLab】,欢迎关注,我们会在这里持续输出团队内部比较有深度的技术沉淀和经验分享,欢迎一起交流。

协议

Apache-2.0 license

DoKit 基于 Apache-2.0 协议进行分发和使用,更多信息参见 协议文件

dokit's People

Contributors

adamcaoqaq avatar bbssyyuui avatar boai avatar bzcoder avatar ccworld1000 avatar cd5z avatar changzuozhen avatar chasontang avatar developerly avatar duanlikang avatar excitedhaha avatar fangyeqing123 avatar heycfarmer avatar hixgb avatar huginchen avatar jtsky avatar linjzong avatar litianhao3615 avatar miracle9312 avatar mizikoi53 avatar realonlyone avatar wangfengye avatar wanglao100 avatar wanglikun7342 avatar wbtiger avatar wizzxu avatar xiandanin avatar yasinzhou avatar ydlsl avatar yixiangboy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dokit's Issues

libDoraemonKit.a

Undefined symbols for architecture arm64:
"OBJC_CLASS$_CNContactStore", referenced from:
objc-class-ref in libDoraemonKit.a(DoraemonAppInfoUtil.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我 pod 'DoraemonKit/Core', '~> 1.0.2' 版本

Android编译失败,Attribute "titleColor" already defined with incompatible format

Attribute "text" already defined with incompatible format.
Message{kind=ERROR, text=Attribute "text" already defined with incompatible format.,
sources=[project/build/intermediates/res/merged/deft/debug/values/values.xml:3043], 
original message=, tool name=Optional.of(AAPT)}

Attribute "titleColor" already defined with incompatible format.
Message{kind=ERROR, text=Attribute "titleColor" already defined with incompatible format., 
sources=[/build/intermediates/res/merged/deft/debug/values/values.xml:3148],
original message=, tool name=Optional.of(AAPT)}

资源属性冲突,建议对属性也加上前缀。

是否可以提供实时检测,比如我一边操作app,一边看cpu的使用情况或者流量使用情况

Please complete the following informations.

Expected behavior and actual behavior.
Steps to reproduce the problem.
Android or iOS? OS version? Brand?
More informations such as error messages and stack traces are welcomed.

请补充如下信息。

期望的表现和实际的表现。(如有)
问题重现的步骤。(如有)
Android 还是 iOS?系统版本是多少?手机品牌是什么?(如有)
其他的错误信息和堆栈信息如果有也可以一并提供出来。(如有)

android 帧率 cpu 内存 无法查看 miui10 android8.1 未root

Please complete the following informations.

Expected behavior and actual behavior.
Steps to reproduce the problem.
Android or iOS? OS version? Brand?
More informations such as error messages and stack traces are welcomed.

请补充如下信息。

期望的表现和实际的表现。(如有)
android 帧率 cpu 内存无法查看
问题重现的步骤。(如有)
按文档进行下列步骤接入sdk

dependencies {
	
    debugImplementation 'com.didichuxing.doraemonkit:doraemonkit:1.0.5'
    releaseImplementation 'com.didichuxing.doraemonkit:doraemonkit-no-op:1.0.5'
  
}

    DoraemonKit.install(application)

进入具体某个页面点击悬浮窗开启 cpu ram 帧率 这三个 按返回键 ,

内存cpu frame始终是0

Android 还是 iOS?系统版本是多少?手机品牌是什么?(如有)

android 红米5plus miui10 android8.1

其他的错误信息和堆栈信息如果有也可以一并提供出来。(如有)

TencentLBSLocationManager 无法正常 Mock GPS 信息

1. 期望的表现和实际的表现。(如有)

正常 Mock GPS 信息

2. 问题重现的步骤。(如有)

使用腾讯云 SDK 的 pod 库 QCloudCOSXML 后,初始化 TencentLBSLocationManager 时,挂在 CLLocationManager+Doraemon.m 的第 28 行:

NSAssert(NO, @"你在Delegate %@ 中所使用的SEL %@,暂不支持,请联系DoraemonKit开发者",delegate,sel);

delegate 类型为 TencentLBSLocationManager

3. Android 还是 iOS?系统版本是多少?手机品牌是什么?(如有)

iOS / 任意型号

4. 其他的错误信息和堆栈信息如果有也可以一并提供出来。(如有)

Mock GPS输入经纬度搜索后,点击任何区域键盘无法隐藏

Please complete the following informations.

Expected behavior and actual behavior.
Steps to reproduce the problem.
Android or iOS? OS version? Brand?
More informations such as error messages and stack traces are welcomed.

请补充如下信息。

期望的表现和实际的表现。(如有)
问题重现的步骤。(如有)
Android 还是 iOS?系统版本是多少?手机品牌是什么?(如有)
其他的错误信息和堆栈信息如果有也可以一并提供出来。(如有)

能否提供no-op的依赖?

在application初始化时,需要引入代码,由于不建议把功能带到线上,会导致在编译线上包时,若不删除application中的相关代码,则会编译失败。建议提供no-op的依赖,这样就不用修改application中额代码了,即依赖可以写成:

debugImplementation 'com.didichuxing.doraemonkit:doraemonkit:1.0.1'
releaseImplementation 'com.didichuxing.doraemonkit:doraemonkit-no-op:1.0.1'

包含 DoraemonLoadAnalyze.framework 后无法正常 Archive

1. 期望的表现和实际的表现。(如有)

正常使用 Load 耗时模块的同时能够正常打包

2. 问题重现的步骤。(如有)

工程中引入 DoraemonKit 库后,Aarchive 时挂掉:

看起来像是 DoraemonLoadAnalyze.framework 没有提供 armv7 对应的版本

3. Android 还是 iOS?系统版本是多少?手机品牌是什么?(如有)

iOS / 任意型号

4. 其他的错误信息和堆栈信息如果有也可以一并提供出来。(如有)

ld: warning: ignoring file /Users/eyrefree/Documents/XXX/Pods/DoraemonKit/iOS/DoraemonKit/Framework/DoraemonLoadAnalyze.framework/DoraemonLoadAnalyze, missing required architecture armv7 in file /Users/eyrefree/Documents/XXX/Pods/DoraemonKit/iOS/DoraemonKit/Framework/DoraemonLoadAnalyze.framework/DoraemonLoadAnalyze (2 slices)
Undefined symbols for architecture armv7:
  "_dlaLoadModels", referenced from:
      -[DoraemonMethodUseTimeListViewController viewDidLoad] in DoraemonMethodUseTimeListViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

报错No Activity found to handle Intent

手机:oppo r9m
系统:5.1
报错信息:
Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.action.MANAGE_OVERLAY_PERMISSION dat=package:com.xbkj.caruser }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1792)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
at android.app.Activity.startActivityForResult(Activity.java:3896)
at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767)
at android.app.Activity.startActivityForResult(Activity.java:3845)
at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754)
at android.app.Activity.startActivity(Activity.java:4232)
at android.app.Activity.startActivity(Activity.java:4147)
at com.didichuxing.doraemonkit.util.PermissionUtil.requestDrawOverlays(PermissionUtil.java:89)
at com.didichuxing.doraemonkit.DoraemonKit.requestPermission(DoraemonKit.java:175)
at com.didichuxing.doraemonkit.DoraemonKit.access$100(DoraemonKit.java:46)
at com.didichuxing.doraemonkit.DoraemonKit$1.onActivityResumed(DoraemonKit.java:85)
at android.app.Application.dispatchActivityResumed(Application.java:216)
at android.app.Activity.onResume(Activity.java:1248)
at androidx.fragment.app.FragmentActivity.onResume(FragmentActivity.java:514)
at com.trello.rxlifecycle2.components.support.RxAppCompatActivity.onResume(RxAppCompatActivity.java:73)
at com.xbkj.caruser.framwork.BaseActivity.onResume(BaseActivity.java:250)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1267)
at android.app.Activity.performResume(Activity.java:6337)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3422)

请教使用BSBacktraceLogger的意义

请教一下为什么要引入 BSBacktraceLogger 这个库来获取调用堆栈,不直接使用系统提供的方法,是有什么深意吗?[NSThread callStackSymbols] 这个API我觉得完全可以胜任。

使用 BSBacktraceLogger 打印的堆栈信息:

BSBacktraceLogger: Backtrace of Thread 14851:
libsystem_kernel.dylib 0x1091c820a mach_msg_trap + 10
libsystem_kernel.dylib 0x1091c43b3 thread_get_state + 403
BeeHiveDemo 0x103548a1a bs_mach_copyMem + 58
BeeHiveDemo 0x103548103 _bs_backtraceOfThread + 675
BeeHiveDemo 0x103547e2b +[BSBacktraceLogger bs_backtraceOfNSThread:] + 59
BeeHiveDemo 0x103548729 +[BSBacktraceLogger bs_backtraceOfCurrentThread] + 89
BeeHiveDemo 0x103601f7a -[UIView(DoraemonSubThreadUICheck) uiCheck] + 170
BeeHiveDemo 0x103601e58 -[UIView(DoraemonSubThreadUICheck) doraemon_setNeedsDisplay] + 72
UIKitCore 0x10efce01e -[UILabel setNeedsDisplay] + 53
UIKitCore 0x10f43ee4e -[UIView _createLayerWithFrame:] + 937
UIKitCore 0x10f43f817 UIViewCommonInitWithFrame + 856
UIKitCore 0x10f43f481 -[UIView initWithFrame:] + 98
UIKitCore 0x10efc4b06 -[UILabel initWithFrame:] + 62
UIKitCore 0x10f43ea9f -[UIView init] + 44
UIKitCore 0x10f714b00 -[_UINavigationBarContentView _setupTitleViewAnimated:] + 778
UIKitCore 0x10f71690e -[_UINavigationBarContentView updateContentAnimated:] + 86
UIKitCore 0x10f74d417 -[_UINavigationBarVisualProviderModernIOS _updateContentForTopItem:backItem:animated:] + 1926
UIKitCore 0x10f751105 -[_UINavigationBarVisualProviderModernIOS navigationItemUpdatedTitleContent:animated:] + 214
UIKitCore 0x10f05a9f3 -[UINavigationItem _notifyObserver_navigationItemUpdatedTitleContentAnimated:] + 62
UIKitCore 0x10f05a849 -[UINavigationItem setTitle:] + 247
UIKitCore 0x10f48b56e -[UIViewController setTitle:] + 127
BeeHiveDemo 0x10350db51 __29-[ViewController viewDidLoad]_block_invoke + 49
libdispatch.dylib 0x108e1d5d1 _dispatch_call_block_and_release + 12
libdispatch.dylib 0x108e1e63e _dispatch_client_callout + 8
libdispatch.dylib 0x108e210a0 _dispatch_queue_override_invoke + 1028
libdispatch.dylib 0x108e2f028 _dispatch_root_queue_drain + 351
libdispatch.dylib 0x108e2f9cd _dispatch_worker_thread2 + 130
libsystem_pthread.dylib 0x109208169 _pthread_wqthread + 1387
libsystem_pthread.dylib 0x109207be9 start_wqthread + 13

使用 [NSThread callStackSymbols] 打印的堆栈信息:
callStackSymbols: (
0 BeeHiveDemo 0x0000000103601fbd -[UIView(DoraemonSubThreadUICheck) uiCheck] + 237
1 BeeHiveDemo 0x0000000103601e58 -[UIView(DoraemonSubThreadUICheck) doraemon_setNeedsDisplay] + 72
2 UIKitCore 0x000000010efce01e -[UILabel setNeedsDisplay] + 53
3 UIKitCore 0x000000010f43ee4e -[UIView _createLayerWithFrame:] + 937
4 UIKitCore 0x000000010f43f817 UIViewCommonInitWithFrame + 856
5 UIKitCore 0x000000010f43f481 -[UIView initWithFrame:] + 98
6 UIKitCore 0x000000010efc4b06 -[UILabel initWithFrame:] + 62
7 UIKitCore 0x000000010f43ea9f -[UIView init] + 44
8 UIKitCore 0x000000010f714b00 -[_UINavigationBarContentView _setupTitleViewAnimated:] + 778
9 UIKitCore 0x000000010f71690e -[_UINavigationBarContentView updateContentAnimated:] + 86
10 UIKitCore 0x000000010f74d417 -[_UINavigationBarVisualProviderModernIOS _updateContentForTopItem:backItem:animated:] + 1926
11 UIKitCore 0x000000010f751105 -[_UINavigationBarVisualProviderModernIOS navigationItemUpdatedTitleContent:animated:] + 214
12 UIKitCore 0x000000010f05a9f3 -[UINavigationItem _notifyObserver_navigationItemUpdatedTitleContentAnimated:] + 62
13 UIKitCore 0x000000010f05a849 -[UINavigationItem setTitle:] + 247
14 UIKitCore 0x000000010f48b56e -[UIViewController setTitle:] + 127
15 BeeHiveDemo 0x000000010350db51 __29-[ViewController viewDidLoad]_block_invoke + 49
16 libdispatch.dylib 0x0000000108e1d5d1 _dispatch_call_block_and_release + 12
17 libdispatch.dylib 0x0000000108e1e63e _dispatch_client_callout + 8
18 libdispatch.dylib 0x0000000108e210a0 _dispatch_queue_override_invoke + 1028
19 libdispatch.dylib 0x0000000108e2f028 _dispatch_root_queue_drain + 351
20 libdispatch.dylib 0x0000000108e2f9cd _dispatch_worker_thread2 + 130
21 libsystem_pthread.dylib 0x0000000109208169 _pthread_wqthread + 1387
22 libsystem_pthread.dylib 0x0000000109207be9 start_wqthread + 13
)

DoraemonStatisticsUtil 模块网络请求报错

1. 期望的表现和实际的表现。(如有)

  1. 建议移除 DoraemonStatisticsUtil,有使用顾虑;
  2. 一定要采集数据的话,上个 HTTPS 吧,炸一堆 Log 到 Console 里挺尴尬的。

2. 问题重现的步骤。(如有)

工程中引入 DoraemonKit 库后,Xcode 中 Console 报错统计接口 uploadAppData 接口由于 ATP 所以请求失败:

3. Android 还是 iOS?系统版本是多少?手机品牌是什么?(如有)

iOS / 任意型号

4. 其他的错误信息和堆栈信息如果有也可以一并提供出来。(如有)

Task <500A5CFF-A68B-4855-8A17-01BD2B28F7A1>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection., NSErrorFailingURLStringKey=http://doraemon.xiaojukeji.com/uploadAppData, NSErrorFailingURLKey=http://doraemon.xiaojukeji.com/uploadAppData, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <500A5CFF-A68B-4855-8A17-01BD2B28F7A1>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <500A5CFF-A68B-4855-8A17-01BD2B28F7A1>.<1>, NSUnderlyingError=0x282e1b270 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "(null)"}} [-1022]

增加启动时间记录?

先给大佬们 手动点赞👍
提个小需求 记录下启动时间 帮助优化App。
最好能定位耗时过程,虽然 Instruments已经很详细 但是集成版本有的话就更方便了。

iOS『App基本信息』模块的网络权限判断有误

运行环境

  • 设备:All
  • 系统:iOS 12.1
  • Xcode 版本:10.1
  • DoraemonKit 版本:1.0.3

具体问题

实际上设备已经完全授权了网络权限,但CTCellularDataRestrictedState查询网络授权状态 有误:
image

可能原因

CTCellularData这个类设计成所有的状态变化都通过cellularDataRestrictionDidUpdateNotifier来触发,必须在其block内获取状态信息
image

其他

  • 另外需要注意的是:在模拟器上
    typedef void (^CellularDataRestrictionDidUpdateNotifier)(CTCellularDataRestrictedState);这个回调是不会进的,不过模拟上对网络权限也没啥好判断的😓

  • CTCellularData这个类有局限性,只能判断出:未知完全授权(蜂窝 && WIFI) 以及 不完全授权(only WIFI || both 关闭),如果需要更详尽的判断可以参考简书: 检测 iOS 系统网络权限被关闭
    MARK: 作者在DoraemonKit群里 @zie

Android 版本控件检测的红色虚线位置不对

  • 手机信息: Vivo Y53 Android 6.0.1

  • 布局信息:

     <?xml version="1.0" encoding="utf-8"?>
     <android.support.constraint.ConstraintLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:id="@+id/root"
     android:layout_width="match_parent"
     android:layout_height="match_parent" >
         <FrameLayout
             android:id="@+id/tool_bar"
             android:layout_width="0dp"
             android:layout_height="50dp"
             android:background="@color/white"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent"/>
    
         <android.support.v7.widget.RecyclerView
             android:id="@+id/recycler_view"
             android:layout_width="0dp"
             android:layout_height="0dp"
             android:background="#F2F2F2"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/tool_bar"
             />
     </android.support.constraint.ConstraintLayout>

Android 流量监控插件集成警告

DoraemonPlugin 中,增加aspectj,但是gradle 3.+ 会报warning,

WARNING: Configuration 'debugCompile' is obsolete and has been replaced with 'debugImplementation' and 'debugApi'.

 project.dependencies {
      // TODO this should come transitively
      debugCompile 'org.aspectj:aspectjrt:1.8.6'
    }

iOS 添加带有UIWindow参数的初始化方法

期望的表现和实际的表现。(如有)
能否添加一个带有window的初始化方法
问题重现的步骤。(如有)
我们的项目中AppDelegate没有window属性,初始化DoreamonKit后就会闪退。

Note:希望添加监控网络请求详情的功能

pod install 报错

~pod install 失败,报错信息:

Fetching podspec for 'DoraemonKit' from '../'
[ ! ] Unable to find a specification for 'BSBacktraceLogger' depended upon by 'DoraemonKit/WithLogger'

能不能不要自己随便搞分类

像.bottom .top 你和masonry冲突了, masonry至少还能让用户选择,他默认是有加mas_的前缀,你们也试着优化下啊,比起你这个,正常masonry用户肯定是用masonry用的多啊。。把那个uiview+position那个分类加个前缀吧

iOS11以下版本点击沙盒浏览功能崩溃

崩溃信息:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableView setContentInsetAdjustmentBehavior:]: unrecognized selector sent to instance 0x7f883e922e00'
*** First throw call stack:
(
0 CoreFoundation 0x000000010c16ee65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000110ec0deb objc_exception_throw + 48
2 CoreFoundation 0x000000010c17748d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010c0c490a forwarding + 970
4 CoreFoundation 0x000000010c0c44b8 _CF_forwarding_prep_0 + 120
5 Finance 0x00000001091e829b -[DoraemonSandboxViewController initUI] + 619
6 Finance 0x00000001091e7ebe -[DoraemonSandboxViewController viewDidLoad] + 94
7 UIKit 0x000000010e0a4f98 -[UIViewController loadViewIfRequired] + 1198
8 UIKit 0x000000010e0e9651 -[UINavigationController _layoutViewController:] + 54
9 UIKit 0x000000010e0e9f26 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 462
10 UIKit 0x000000010e0ea098 -[UINavigationController _startTransition:fromViewController:toViewController:] + 126
11 UIKit 0x000000010e0eb2f1 -[UINavigationController _startDeferredTransitionIfNeeded:] + 890
12 UIKit 0x000000010e0ec3af -[UINavigationController __viewWillLayoutSubviews] + 57
13 UIKit 0x000000010e292ff7 -[UILayoutContainerView layoutSubviews] + 248
14 UIKit 0x000000010dfc54a3 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
15 QuartzCore 0x000000010dc8f59a -[CALayer layoutSublayers] + 146
16 QuartzCore 0x000000010dc83e70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
17 QuartzCore 0x000000010dc83cee _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
18 QuartzCore 0x000000010dc78475 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
19 QuartzCore 0x000000010dca5c0a _ZN2CA11Transaction6commitEv + 486
20 UIKit 0x000000010df08f7c _UIApplicationHandleEventQueue + 7329
21 CoreFoundation 0x000000010c09aa31 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
22 CoreFoundation 0x000000010c09095c __CFRunLoopDoSources0 + 556
23 CoreFoundation 0x000000010c08fe13 __CFRunLoopRun + 867
24 CoreFoundation 0x000000010c08f828 CFRunLoopRunSpecific + 488
25 GraphicsServices 0x000000011287fad2 GSEventRunModal + 161
26 UIKit 0x000000010df0e610 UIApplicationMain + 171
27 Finance 0x0000000108b56220 main + 112
28 libdyld.dylib 0x0000000111c7092d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

这边看了下,导致这个崩溃的原因是DoraemonSandboxViewController.m文件的第51行

  • (void)initUI 函数里的
    self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic;
    这行代码崩溃了,contentInsetAdjustmentBehavior这个属性只有大于等于iOS11版本才有,所以iOS11版本以下会崩溃,请帮忙做下兼容,谢谢哈~

iOS 『元素边框线』对于UIStatusBarWindow的遗漏

每当状态栏发生变化(如: 时间跳动4G切WIFI横竖屏切换等),状态栏会走layoutSubviews方法,会导致状态栏也出现元素边框;

[UIApplication sharedApplication].windows数组内拿不到UIStatusBarWindow,关闭元素边框无法及时隐藏状态栏的边框线:

关闭了元素边框,但状态栏还在显示

解决方法供参考:

  • DoraemonViewMetricsConfig.m- (void)setEnable:(BOOL)enable 加上对状态栏的额外判断:
- (void)setEnable:(BOOL)enable
{
    _enable = enable;
    
    ....以前的判断.....

    // 每当状态栏发生变化(如: 时间跳动,4G切WIFI,横竖屏切换等),状态栏会走`layoutSubviews`方法,会导致状态栏也出现元素边框;而[UIApplication sharedApplication].windows数组内拿不到UIStatusBarWindow,关闭元素边框无法及时隐藏状态栏的边框线
    // 也可以在`UIView+DoraemonViewMetrics.h`内的`shouldShowMetricsView`中直接禁掉状态栏的元素边框
    NSString *statusBarString = [NSString stringWithFormat:@"_statusBarWindow"];
    UIWindow *statusBarWindow = [[UIApplication sharedApplication] valueForKey:statusBarString];
    if (statusBarWindow) {
        if (!enable) {
            [statusBarWindow hideDoraemonMetricsRecursive];
        }
    }
}

  • 或者直接禁掉状态栏的元素边框,UIView+DoraemonViewMetrics.h- (BOOL)shouldShowMetricsView
- (BOOL)shouldShowMetricsView
{
    ....其他的情况....
    
    // 状态栏不需要显示元素边框
    NSString *statusBarString = [NSString stringWithFormat:@"_statusBarWindow"];
    UIWindow *statusBarWindow = [[UIApplication sharedApplication] valueForKey:statusBarString];
    if (statusBarWindow && [self isDescendantOfView:statusBarWindow]) {
        return NO;
    }

    return YES;
}

屏幕支持不完善

Please complete the following informations.

Expected behavior and actual behavior.
Steps to reproduce the problem.
Android or iOS? OS version? Brand?
More informations such as error messages and stack traces are welcomed.

请补充如下信息。

期望的表现和实际的表现。(如有)
屏幕支持有些问题,比方说:
横屏的时候,组件检查显示的内容是竖屏的,小屏幕显示不全
横屏的时候,带刘海的机型在显示设备信息的时候显示不全

问题重现的步骤。(如有)
Android 还是 iOS?系统版本是多少?手机品牌是什么?(如有)
iOS
其他的错误信息和堆栈信息如果有也可以一并提供出来。(如有)

包含 DoraemonLoadAnalyze.framework 后无法在默认的 `ENABLE_BITCODE = YES` 模式下正常 Archive

1. 期望的表现和实际的表现。(如有)

正常使用 Load 耗时模块的同时能够在 ENABLE_BITCODE = YES 模式下正常打包

2. 问题重现的步骤。(如有)

工程中引入 DoraemonKit 库后,Aarchive 时挂掉:

看起来像是 DoraemonLoadAnalyze.framework 提供的 armv7 对应版本没有在 ENABLE_BITCODE = YES 模式下生成

3. Android 还是 iOS?系统版本是多少?手机品牌是什么?(如有)

iOS / 任意型号

4. 其他的错误信息和堆栈信息如果有也可以一并提供出来。(如有)

ld: bitcode bundle could not be generated because '/Users/eyrefree/Documents/XXX/Pods/DoraemonKit/iOS/DoraemonKit/Framework/DoraemonLoadAnalyze.framework/DoraemonLoadAnalyze' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build file '/Users/eyrefree/Documents/XXX/Pods/DoraemonKit/iOS/DoraemonKit/Framework/DoraemonLoadAnalyze.framework/DoraemonLoadAnalyze' for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

5. 临时解决方案

在 Podfile 合适的地方添加如下代码:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            if 'DoraemonKit' == config.build_settings['PRODUCT_NAME']
                config.build_settings['ENABLE_BITCODE'] = 'NO'
            end
        end
    end
end

fastlane 打包导出会有问题

应该还是 bitcode 的问题:
2019-02-15 16:16:44.044 xcodebuild[2770:4958222] [MT] IDEDistribution: Step failed: <IDEDistributionPackagingStep: 0x7f921fc6d810>: Error Domain=IDEFoundationErrorDomain Code=1 "Failed to verify bitcode in DoraemonLoadAnalyze.framework/DoraemonLoadAnalyze:
error: Bundle only contains bitcode-marker /var/folders/1w/mfxlxzjn69b6rnvcq9s82bym0000gn/T/XcodeDistPipeline.5O4/Root/Payload/TuandaiLoan.app/Frameworks/DoraemonLoadAnalyze.framework/DoraemonLoadAnalyze (armv7)

" UserInfo={NSLocalizedDescription=Failed to verify bitcode in DoraemonLoadAnalyze.framework/DoraemonLoadAnalyze:
error: Bundle only contains bitcode-marker /var/folders/1w/mfxlxzjn69b6rnvcq9s82bym0000gn/T/XcodeDistPipeline.5O4/Root/Payload/TuandaiLoan.app/Frameworks/DoraemonLoadAnalyze.framework/DoraemonLoadAnalyze (armv7)

}
error: exportArchive: Failed to verify bitcode in DoraemonLoadAnalyze.framework/DoraemonLoadAnalyze:
error: Bundle only contains bitcode-marker /var/folders/1w/mfxlxzjn69b6rnvcq9s82bym0000gn/T/XcodeDistPipeline.5O4/Root/Payload/TuandaiLoan.app/Frameworks/DoraemonLoadAnalyze.framework/DoraemonLoadAnalyze (armv7)

Error Domain=IDEFoundationErrorDomain Code=1 "Failed to verify bitcode in DoraemonLoadAnalyze.framework/DoraemonLoadAnalyze:
error: Bundle only contains bitcode-marker /var/folders/1w/mfxlxzjn69b6rnvcq9s82bym0000gn/T/XcodeDistPipeline.5O4/Root/Payload/TuandaiLoan.app/Frameworks/DoraemonLoadAnalyze.framework/DoraemonLoadAnalyze (armv7)

iOS 如果能够复制抓取的流量数据就完美了

Please complete the following informations.

Expected behavior and actual behavior.
Steps to reproduce the problem.
Android or iOS? OS version? Brand?
More informations such as error messages and stack traces are welcomed.

请补充如下信息。

期望的表现和实际的表现。(如有)
问题重现的步骤。(如有)
Android 还是 iOS?系统版本是多少?手机品牌是什么?(如有)
其他的错误信息和堆栈信息如果有也可以一并提供出来。(如有)

Recommendations for Optimize the WebDoor Kit

Android SDK:
WebDoor Kit Callback,can add the context for the next page to the callback

public interface WebDoorCallback {
    void overrideUrlLoading(String url); //can add the context for the next page to the callback
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.