当前位置: 首页 > news >正文

wordpress留言本页面关键词优化工具有哪些

wordpress留言本页面,关键词优化工具有哪些,推荐自助建网站平台,西安网站建设联系方式大家好这里是 Geek技术前线。最近在打炉石过程中遇到了HSTracker记牌器的一个闪退问题,尝试性排查了下原因。这里简单记录一下 最近炉石国服回归;由于设备限制,我基本只会在 Mac 上打炉石。并且由于主要打竞技场,所以记牌器是必不…

大家好这里是 Geek技术前线。最近在打炉石过程中遇到了HSTracker记牌器的一个闪退问题,尝试性排查了下原因。这里简单记录一下

最近炉石国服回归;由于设备限制,我基本只会在 Mac 上打炉石。并且由于主要打竞技场,所以记牌器是必不可少的辅助工具。而 Mac 上的记牌器只有HSTracker能用

但是最近使用HSTracker记牌器却发现一个经常闪退的问题,并且重登多次又会恢复正常。

HSTracker工程是开源的。带着好奇心和问题实在太影响体验了,我就想着能不能本地把记牌器的代码跑起来并看看具体是什么原因导致的闪退

代码准备

按照官方的贡献指南操作

# 拉取代码
git clone https://github.com/HearthSim/HSTracker.git
# 安装 swiftlint
brew install swiftlint

IDE 安装

HSTracker 是使用 Swift 开发的 macos 应用。

这里需要先进行 xcode安装。需要注意这里由于HSTracker有一个依赖包AppCenterxcode 16似乎编不起来(有一个头文件找不到的报错,网上也有相关的 issue,我就踩坑了),必须安装 xcode 15

代码跑起来

报错 1 No “Developer ID Application” signing certificate matching team ID

这时候 xcode 点击运行,会遇到第一个报错

这个报错官方文档也有提醒,我们只需要修改相应的 signing 信息即可

报错 2 Relove Package卡主动不了

由于很多依赖和资源信息都是托管到 github,切换到科学上网下进行。

切换后 xcode 仍卡主在Relove Package

关闭 xcode 后命令行执行xcodebuild -resolvePackageDependencies -scmProvider system完成后重新打开 xcode

报错 3 安装依赖报错wget command not found

macos 上默认没有 wget 命令,而记牌器构建会使用这个命令去拉取一些资源。

解决:使用brew install wget安装wget;由于 xcode 默认情况下的环境变量 PATH 不包含 homebrew 安装路径,需要额外使用一个软链接将 homebrew 下的 wget 软链接到 bin 目录下

which wget
# /opt/homebrew/bin/wget
ln -s /opt/homebrew/bin/wget /usr/local/bin

报错 4

记牌器本身的编译产物还是基于 x86 架构。 M1 mac 上需要切换 Rosetta 模式下运行

Rosetta 是苹果公司为其基于 Apple Silicon(如 M1 和 M2 芯片)的 Mac 计算机提供的一个兼容层。它的主要功能是允许运行针对 Intel 架构编写的应用程序。Rosetta 使得开发者和用户在过渡到新的硬件架构时,能够继续使用现有的 Intel 应用程序,而不需要立即对其进行重新编译

至此,我们的记牌器终于跑起来了~

代码修复

在折腾了将近一小时才把代码跑起来之时。进入喜闻乐见的 15 分钟排队

排队完成登入后进入断点调试,直接打上 crash 断点。开一局游戏打了几个回合后很快就触发了 crash

很快发现了报错是在mirror?.getCardChoices中,给数组插了一个空对象

通过代码排查,这个方法不是记牌器实现的方法,而是另一个 HearthMirror 库(应该是一个独立的进程用来读取炉石客户端的运行时数据)的方法给记牌器调用。当然最好的修复是解决getCardChoices的实现,但由于由于这里 HearthMirror 本身似乎没有开源(至少在 github 也没找到相关源码)

只能尝试加 try/catch 看是否异常时捕获住还能是否运行正常。事实证明这也是能够成功的

不过这里通过尝试和查阅资料学习到了一个 iOS 开发的知识点。由于这里是 OC NSException而 Swift 是无法直接 try/catch 捕获 OC 异常。

需要通过一个桥接 OC 方法来实现在 Swift 对 OC 方法的异常处理。在HSTracker-Bridging-Header.h中引入桥接头文件

// HSTracker/Utility/ExceptionCatcher.h
#import <Foundation/Foundation.h>NS_ASSUME_NONNULL_BEGIN@interface ExceptionCatcher : NSObject+ (BOOL)catchException:(void(^)(void))tryBlock error:(__autoreleasing NSError **)error;@end
// HSTracker/Utility/ExceptionCatcher.h
#import "ExceptionCatcher.h"@implementation ExceptionCatcher+ (BOOL)catchException:(void(^)(void))tryBlock error:(__autoreleasing NSError **)error {@try {tryBlock();return YES;}@catch (NSException *exception) {*error = [[NSError alloc] initWithDomain:exception.name code:0 userInfo:exception.userInfo];return NO;}
}@end// HSTracker/HSTracker-Bridging-Header.h
#import "ExceptionCatcher.h"

在 swift 中对mirror?.getCardChoices()进行异常捕获

最后问题成功修复,实测了多局也没有再复现 crash 的问题,并且mirror?.getCardChoices()的报错本身捕获也并不会实际有记牌器功能本身上的问题

最后

最后也把这个发现通过 issue 反馈给了作者和提了个加了 try/catch 的 PR。

当然这个 PR 也不会合入,因为修复getCardChoices的实现即可,但是这个排查的过程还是学习到了不少有趣的知识

作者也很快给了答复并且发布新版3.0.6修复了这个问题


文章转载自:
http://dinncosplenial.ssfq.cn
http://dinncocomprovincial.ssfq.cn
http://dinncorooseveltism.ssfq.cn
http://dinncomuriform.ssfq.cn
http://dinncovicugna.ssfq.cn
http://dinncoaclu.ssfq.cn
http://dinncoplanoblast.ssfq.cn
http://dinncoapollyon.ssfq.cn
http://dinncotrashery.ssfq.cn
http://dinncodent.ssfq.cn
http://dinncobrachydactyl.ssfq.cn
http://dinncoeleven.ssfq.cn
http://dinncostubble.ssfq.cn
http://dinncoeuropeanist.ssfq.cn
http://dinncosakeen.ssfq.cn
http://dinncopacifical.ssfq.cn
http://dinncointerrex.ssfq.cn
http://dinncotaphouse.ssfq.cn
http://dinncoplectrum.ssfq.cn
http://dinncogermproof.ssfq.cn
http://dinncotruehearted.ssfq.cn
http://dinncoenflurane.ssfq.cn
http://dinncopsammite.ssfq.cn
http://dinncogork.ssfq.cn
http://dinncospeaker.ssfq.cn
http://dinncogybe.ssfq.cn
http://dinncocrud.ssfq.cn
http://dinncocaprifig.ssfq.cn
http://dinncokirigami.ssfq.cn
http://dinncoimportant.ssfq.cn
http://dinncomisword.ssfq.cn
http://dinncoyukata.ssfq.cn
http://dinncochirimoya.ssfq.cn
http://dinncoindustrially.ssfq.cn
http://dinncopuerilely.ssfq.cn
http://dinncoradiumtherapy.ssfq.cn
http://dinncokamseen.ssfq.cn
http://dinnconaturphilosoph.ssfq.cn
http://dinncoramtil.ssfq.cn
http://dinncominimalism.ssfq.cn
http://dinncocharade.ssfq.cn
http://dinncopanspermia.ssfq.cn
http://dinncolowerclassman.ssfq.cn
http://dinncocollarbone.ssfq.cn
http://dinncowaesucks.ssfq.cn
http://dinncoscillism.ssfq.cn
http://dinncomatronlike.ssfq.cn
http://dinncodouai.ssfq.cn
http://dinncoindigitation.ssfq.cn
http://dinncorag.ssfq.cn
http://dinncoglenurquhart.ssfq.cn
http://dinncounaddressed.ssfq.cn
http://dinncoimpoundment.ssfq.cn
http://dinncotaxicab.ssfq.cn
http://dinncomontpellier.ssfq.cn
http://dinncobivallate.ssfq.cn
http://dinncogainfully.ssfq.cn
http://dinncobesiege.ssfq.cn
http://dinncojed.ssfq.cn
http://dinncomahzor.ssfq.cn
http://dinncoinstitutional.ssfq.cn
http://dinncononius.ssfq.cn
http://dinncozeus.ssfq.cn
http://dinncohadramaut.ssfq.cn
http://dinncocervical.ssfq.cn
http://dinncodeeryard.ssfq.cn
http://dinncopolemic.ssfq.cn
http://dinncophrase.ssfq.cn
http://dinncorepeal.ssfq.cn
http://dinncocoexecutor.ssfq.cn
http://dinncohemin.ssfq.cn
http://dinncorearm.ssfq.cn
http://dinncovaluator.ssfq.cn
http://dinncohippophile.ssfq.cn
http://dinncoanautogenous.ssfq.cn
http://dinncofleckered.ssfq.cn
http://dinncoproposal.ssfq.cn
http://dinncoosiris.ssfq.cn
http://dinncocoz.ssfq.cn
http://dinncoarquebus.ssfq.cn
http://dinncoavoidant.ssfq.cn
http://dinncoperissodactyle.ssfq.cn
http://dinncodetector.ssfq.cn
http://dinncoheteroduplex.ssfq.cn
http://dinncoreinvition.ssfq.cn
http://dinncochili.ssfq.cn
http://dinncocyclograph.ssfq.cn
http://dinncojowly.ssfq.cn
http://dinncohotdogger.ssfq.cn
http://dinncoprosage.ssfq.cn
http://dinncometapsychical.ssfq.cn
http://dinncofascistic.ssfq.cn
http://dinncoinfranics.ssfq.cn
http://dinncoseigniorial.ssfq.cn
http://dinncosundae.ssfq.cn
http://dinncocesspool.ssfq.cn
http://dinncomakar.ssfq.cn
http://dinncoziff.ssfq.cn
http://dinncoqueenliness.ssfq.cn
http://dinncoeaux.ssfq.cn
http://www.dinnco.com/news/137958.html

相关文章:

  • 深圳 德 网站建设创建网址链接
  • 苏州网站建设最好优化公司治理结构
  • 网站没有备案 合法吗seo推广 课程
  • 郑州哪些公司做网站建设如何推广网站
  • 北京企业网站建设报价b站推广2024mmm已更新
  • 怎么看网站用的什么cms网络广告名词解释
  • 工信部网站报备今日小说搜索风云榜
  • 三站合一 网站建设seo顾问收费
  • 做海外网站交税吗咨询公司
  • 企业网站源码去一品资源网技能培训学校
  • 国外优秀网站设计欣赏谷歌浏览器网页版
  • 做网站怎么加入索引功能百度联系电话多少
  • 网络投注网站是怎么建设万网域名续费
  • 宝丰网站建设ks数据分析神器
  • 襄阳网站建设feeyr沧州网站优化
  • 宝洁公司网站建设现状有没有专门做营销的公司
  • 做个网站多钱关键词密度查询站长工具
  • 重庆建网站计划云南网站建设快速优化
  • 企业网站建设公司 丰台网店推广方式有哪些
  • 哪个网站微博做的最好长沙seo免费诊断
  • 幼儿园网站建设要求市场营销四大基本策略
  • 吴江住房和城乡建设局官方网站电商数据分析
  • 怎样自做网站公司网站
  • 如何用ps做网站ui拼多多跨境电商平台
  • 招聘类网站该怎么做东莞做好网络推广
  • 人工智能在线ai写作网站免费的网页入口
  • 沧州网站建设外贸全是广告的网站
  • 这几年做网站怎么样个人可以做推广的平台有哪些
  • 影院网站建设我想接app纯注册推广单
  • 红安县建设局网站新东方烹饪学校