Giter Club home page Giter Club logo

bugly-ios's Introduction

Bugly iOS SDK 接入指南

一. SDK 集成

Bugly提供两种集成方式供iOS开发者选择:

  • CocoaPods
  • 手动集成

如果您是从Bugly 2.0以下版本升级过来的,请查看 Bugly 旧版本顺滑升级指引

1.1 CocoaPods集成方式

命令行下执行pod search Bugly,如显示的Bugly版本不是最新的,则先执行pod repo update操作

在工程的Podfile里面添加以下代码:

pod 'Bugly'

保存并执行pod install,然后用后缀为.xcworkspace的文件打开工程。

关于CocoaPods的更多信息请查看CocoaPods官方网站

1.2 手动集成方式

  • 下载并解压iOS SDK
  • 拖拽Bugly.framework文件到Xcode工程内(请勾选Copy items if needed选项)
  • 添加依赖库
    • SystemConfiguration.framework
    • Security.framework
    • libz.dylib

二. 初始化SDK

2.1 导入头文件

在工程的AppDelegate.m文件导入头文件

#import <Bugly/Bugly.h>

如果是Swift工程,请在对应bridging-header.h中导入

2.2 初始化Bugly

在工程AppDelegate.mapplication:didFinishLaunchingWithOptions:方法中初始化Bugly:

  • Objective-C
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
	[Bugly startWithAppId:@"此处替换为你的AppId"];
	return YES;
}
  • Swift
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
	Bugly.startWithAppId("此处替换为你的AppId")
	return true
}

如果您需要上报iOS Watch2 AppiOS App Extension的异常,请参见Bugly iOS Extension SDK 接入指南

至此,Xcode工程集成Bugly已完成,接下来可以编译并运行你的Xcode工程。

三. 高级功能

Bugly SDK提供一系列自定义配置或接口供开发者调用,如:

  • 文件配置初始化参数
  • 自定义日志
  • 界面追踪
  • 卡顿监控

详细内容请查看iOS SDK高级设置


Bugly iOS SDK高级功能使用指南

一. 文件配置初始化参数

Bugly支持读取Info.plist文件读取SDK初始化参数,可配置的参数如下:

- Appid
	- Key: BuglyAppIDString
	- Value: 字符串类型
- 渠道标识
	- Key: BuglyAppChannelString
	- Value: 字符串类型
- 版本信息
	- Key: BuglyAppVersionString
	- Value: 字符串类型
- 开启Debug信息显示
	- Key: BuglyDebugEnable
	- Value: BOOL类型

如下初始化方式,则会读取Info.plist内添加的key-value配置进行SDK初始化:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
	// 读取Info.plist中的参数初始化SDK
	[Bugly startWithAppId:nil];
	return YES;
}

二. 自定义日志

SDK提供自定义日志打印接口,用于记录一些关键的业务调试信息,可以更全面地反应App发生崩溃或异常时的上下文环境。

使用方式与NSLog一致,可定义日志级别以便过滤,日志接口宏定义如下:

BLYLogError(fmt, ...)
BLYLogWarn(fmt, ...)
BLYLogInfo(fmt, ...)
BLYLogDebug(fmt, ...)
BLYLogVerbose(fmt, ...)

void BLYLog(BuglyLogLevel level, NSString *format, ...);
void BLYLogv(BuglyLogLevel level, NSString *format, va_list args);

三. 接口声明

1. 功能配置

/**
 *  SDK Debug 信息开关, 默认关闭
 */
@property (nonatomic, assign) BOOL debugMode;

/**
 *  设置自定义渠道标识
 */
@property (nonatomic, copy) NSString *channel;

/**
 *  设置自定义版本号
 */
@property (nonatomic, copy) NSString *version;

/**
 *  设置自定义设备唯一标识
 */
@property (nonatomic, copy) NSString *deviceId;

/**
 *  卡顿监控开关,默认关闭
 */
@property (nonatomic, assign) BOOL blockMonitorEnable;

/**
 *  卡顿监控判断间隔,单位为秒
 */
@property (nonatomic, assign) NSTimeInterval blockMonitorTimeout;

/**
 *  ATS开关,默认开启。如果关闭,SDK的网络请求不会通过HTTPS发送
 */
@property (nonatomic) BOOL appTransportSecurityEnable;

/**
 *  进程内还原开关,默认开启。
 */
@property (nonatomic) BOOL symbolicateInProcessEnable;

/**
 *  非正常退出事件记录开关,默认关闭
 */
@property (nonatomic) BOOL unexpectedTerminatingDetectionEnable;

/**
 *  页面信息记录开关,默认开启
 */
@property (nonatomic) BOOL viewControllerTrackingEnable;

/**
 *  SDK回调
 */
@property (nonatomic, assign) id<BuglyDelegate> delegate;

/**
 * 控制自定义日志上报,默认值为BuglyLogLevelWarn,只上报Warn、Error的日志。
 * 设置为BuglyLogLevelSilent可关闭日志上报。
 */
@property (nonatomic, assign) BuglyLogLevel reportLogLevel;

2. SDK回调

/**
 *  发生异常时回调
 *
 *  @param exception 异常信息
 *
 *  @return 返回需上报记录,随异常上报一起上报
 */
- (NSString *)attachmentForException:(NSException *)exception;

3. 功能接口

/**
 *  初始化Bugly,使用默认BuglyConfig
 *
 *  @param appId 注册Bugly分配的应用唯一标识,如果appId为空,则读取Info.plist中的参数配置
 */
+ (void)startWithAppId:(nullable NSString *)appId;

/**
 *  使用指定配置初始化Bugly
 *
 *  @param appId 注册Bugly分配的应用唯一标识
 *  @param config 传入配置的 BuglyConfig
 */
+ (void)startWithAppId:(nullable NSString *)appId
                config:(nullable BuglyConfig *)config;

/**
 *  设置用户标识
 *
 *  @param userId 用户标识
 */
+ (void)setUserIdentifier:(nonnull NSString *)userId;

/**
 *  更新应用版本信息
 *
 *  @param version 应用版本信息
 */
+ (void)updateAppVersion:(NSString *)version;

/**
 *  设置关键数据,随崩溃信息上报
 *
 *  @param value
 *  @param key
 */
+ (void)setUserValue:(nonnull NSString *)value
              forKey:(nonnull NSString *)key;

/**
 *  获取关键数据
 *
 *  @return 关键数据
 */
+ (nullable NSDictionary *)allUserValues;

/**
 *  设置标签
 *
 *  @param tag 标签ID,可在网站生成
 */
+ (void)setTag:(NSUInteger)tag;

/**
 *  获取当前设置标签
 *
 *  @return 当前标签ID
 */
+ (NSUInteger)currentTag;

/**
 *  上报自定义异常
 *
 *  @param exception 异常信息
 */
+ (void)reportException:(nonnull NSException *)exception;

/**
 *  上报错误
 *
 *  @param error 错误信息
 */
+ (void)reportError:(NSError *)error;

/**
 *  SDK 版本信息
 *
 *  @return
 */
+ (nonnull NSString *)sdkVersion;

/**
 *  获取设备ID
 *
 *  @return 设备ID
 */
+ (nonnull NSString *)deviceId;

bugly-ios's People

Contributors

iliyf avatar szrambo 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

bugly-ios's Issues

pod install失败

[!] Error installing Bugly
[!] /usr/bin/curl -f -L -o /var/folders/w9/msx6hb5d0392zr__f140qhxr0000gp/T/d20200505-1570-3iox7s/file.zip https://raw.githubusercontent.com/BuglyDevTeam/Bugly-iOS/master/release/Bugly-2.5.2.zip --create-dirs --netrc-optional --retry 2

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

使用Bugly的时候,启动抛出异常

如题。xcode8, 模拟器, iphone6s, 没有奔溃,只是抛出异常

错误如下:

____nwlog_simulate_crash_inner_block_invoke dlopen CrashReporterSupport failed
2016-12-02 10:12:36.116992 op[22548:2527912] [] __nwlog_err_simulate_crash simulate crash failed "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
2016-12-02 10:12:36.124101 op[22548:2527912] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
[x86_64] libnetcore-856.20.4
0 libsystem_network.dylib 0x00000001065ff682 __nw_create_backtrace_string + 123
1 libnetwork.dylib 0x0000000107354932 nw_socket_add_input_handler + 3100
2 libnetwork.dylib 0x00000001073324f4 nw_endpoint_flow_attach_protocols + 3768
3 libnetwork.dylib 0x0000000107331511 nw_endpoint_flow_setup_socket + 563
4 libnetwork.dylib 0x0000000107330270 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
5 libnetwork.dylib 0x000000010734b44d nw_endpoint_handler_path_change + 1261
6 libnetwork.dylib 0x000000010734ae7c nw_endpoint_handler_start + 570
7 libdispatch.dylib 0x000000010637c980 _dispatch_call_block_and_release + 12
8 libdispatch.dylib 0x00000001063a60cd _dispatch_client_callout + 8
9 libdispatch.dylib 0x0000000106383e6b _dispatch_queue_serial_drain + 236
10 libdispatch.dylib 0x0000000106384b9f _dispatch_queue_invoke + 1073
11 libdispatch.dylib 0x00000001063873b7 _dispatch_root_queue_drain + 720
12 libdispatch.dylib 0x000000010638708b _dispatch_worker_thread3 + 123
13 libsystem_pthread.dylib 0x000000010674f4de _pthread_wqthread + 1129
14 libsystem_pthread.dylib 0x000000010674d341 start_wqthread + 13
2016-12-02 10:12:36.311054 op[22548:2527912] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-12-02 10:12:36.313951 op[22548:2527912] [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
2016-12-02 10:12:36.314540 op[22548:2527912] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
[x86_64] libnetcore-856.20.4
0 libsystem_network.dylib 0x00000001065ff682 __nw_create_backtrace_string + 123
1 libnetwork.dylib 0x0000000107354932 nw_socket_add_input_handler + 3100
2 libnetwork.dylib 0x00000001073324f4 nw_endpoint_flow_attach_protocols + 3768
3 libnetwork.dylib 0x0000000107331511 nw_endpoint_flow_setup_socket + 563
4 libnetwork.dylib 0x0000000107330270 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
5 libnetwork.dylib 0x000000010734b44d nw_endpoint_handler_path_change + 1261
6 libnetwork.dylib 0x000000010734ae7c nw_endpoint_handler_start + 570
7 libnetwork.dylib 0x0000000107362ae5 nw_endpoint_resolver_start_next_child + 2240
8 libdispatch.dylib 0x000000010637c980 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x00000001063a60cd _dispatch_client_callout + 8
10 libdispatch.dylib 0x0000000106383e6b _dispatch_queue_serial_drain + 236
11 libdispatch.dylib 0x0000000106384b9f _dispatch_queue_invoke + 1073
12 libdispatch.dylib 0x00000001063873b7 _dispatch_root_queue_drain + 720
13 libdispatch.dylib 0x000000010638708b _dispatch_worker_thread3 + 123
14 libsystem_pthread.dylib 0x000000010674f4de _pthread_wqthread + 1129
15 libsystem_pthread.dylib 0x000000010674d341 start_wqthread + 13
2016-12-02 10:12:41.009 op[22548:2527912] 执行了检查更新功能
2016-12-02 10:12:41.087824 op[22548:2528108] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-12-02 10:12:41.088353 op[22548:2528108] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-12-02 10:12:41.090212 op[22548:2528108] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-12-02 10:12:41.091213 op[22548:2528108] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-12-02 10:12:41.095679 op[22548:2527901] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-12-02 10:12:41.100361 op[22548:2527901] [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
2016-12-02 10:12:41.101036 op[22548:2527901] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
[x86_64] libnetcore-856.20.4
0 libsystem_network.dylib 0x00000001065ff682 __nw_create_backtrace_string + 123
1 libnetwork.dylib 0x0000000107354932 nw_socket_add_input_handler + 3100
2 libnetwork.dylib 0x00000001073324f4 nw_endpoint_flow_attach_protocols + 3768
3 libnetwork.dylib 0x0000000107331511 nw_endpoint_flow_setup_socket + 563
4 libnetwork.dylib 0x0000000107330270 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
5 libnetwork.dylib 0x000000010734b44d nw_endpoint_handler_path_change + 1261
6 libnetwork.dylib 0x000000010734ae7c nw_endpoint_handler_start + 570
7 libnetwork.dylib 0x0000000107362ae5 nw_endpoint_resolver_start_next_child + 2240
8 libdispatch.dylib 0x000000010637c980 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x00000001063a60cd _dispatch_client_callout + 8
10 libdispatch.dylib 0x0000000106383e6b _dispatch_queue_serial_drain + 236
11 libdispatch.dylib 0x0000000106384b9f _dispatch_queue_invoke + 1073
12 libdispatch.dylib 0x00000001063873b7 _dispatch_root_queue_drain + 720
13 libdispatch.dylib 0x000000010638708b _dispatch_worker_thread3 + 123
14 libsystem_pthread.dylib 0x000000010674f4de _pthread_wqthread + 1129
15 libsystem_pthread.dylib 0x000000010674d341 start_wqthread + 13
2016-12-02 10:12:41.297197 op[22548:2527941] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-12-02 10:12:41.300218 op[22548:2527941] [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
2016-12-02 10:12:41.300874 op[22548:2527941] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
[x86_64] libnetcore-856.20.4
0 libsystem_network.dylib 0x00000001065ff682 __nw_create_backtrace_string + 123
1 libnetwork.dylib 0x0000000107354932 nw_socket_add_input_handler + 3100
2 libnetwork.dylib 0x00000001073324f4 nw_endpoint_flow_attach_protocols + 3768
3 libnetwork.dylib 0x0000000107331511 nw_endpoint_flow_setup_socket + 563
4 libnetwork.dylib 0x0000000107330270 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
5 libnetwork.dylib 0x000000010734b44d nw_endpoint_handler_path_change + 1261
6 libnetwork.dylib 0x000000010734ae7c nw_endpoint_handler_start + 570
7 libnetwork.dylib 0x0000000107362ae5 nw_endpoint_resolver_start_next_child + 2240
8 libdispatch.dylib 0x000000010637c980 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x00000001063a60cd _dispatch_client_callout + 8
10 libdispatch.dylib 0x0000000106383e6b _dispatch_queue_serial_drain + 236
11 libdispatch.dylib 0x0000000106384b9f _dispatch_queue_invoke + 1073
12 libdispatch.dylib 0x00000001063873b7 _dispatch_root_queue_drain + 720
13 libdispatch.dylib 0x000000010638708b _dispatch_worker_thread3 + 123
14 libsystem_pthread.dylib 0x000000010674f4de _pthread_wqthread + 1129
15 libsystem_pthread.dylib 0x000000010674d341 start_wqthread + 13

Bugly.start 后, BuglyLog输出异常

执行Bugly.start后, BuglyLog只能输出前几条信息,后面的不会在控制台显示
注释 Bugly.start 后,一切正常

SDK: 2.5.0
Xcode9.2,macOS10.13.1, iOS 11.2

_didReceiveMemoryWarning non-public

bugly v2.4.8,使用cocoapods集成

警告:由于otool -ov反编译出来的文件中方法对应的class为十六进制,无法解析,故无法确认以下API是否为真的调用non-public或只是重名,请项目组自行排查:[_didReceiveMemoryWarning]。
建议:研发规避该私有方法!

我用otool -ov dump出来显示buglysdk库里定义了_didReceiveMemoryWarning方法,强烈建议你们改名!

请将podspec中source的链接更改为https

[!] 'Bugly' uses the unencrypted http protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts in there. Please reach out to the library author to notify them of this security issue.

2.5.0版本表现似乎是死锁的堆栈信息

cocoapods 引入,今天更新到 2.5.0,每次崩溃都会卡住所在线程,故意制造闪退可以重现,堆栈:
screen shot 2017-12-01 at 18 07 24

看堆栈信息似乎是 BLYCPPExceptionTerminate() 里又抛出异常,导致在同一个线程再次进入这个方法,之前的锁还没有释放再次加锁造成死锁

一开始引入 bugly 的时候并没有这个情况,可能是项目增加的一些内容和修改导致,不过不知道这个方法里加锁进行的操作是什么,没有办法判断可能是什么引起的

启动卡死

因为bugly后台版本管理相对弱鸡,所以我开了一个新的产品,一切看上去都很好。
但是神奇的事情发生了,当第一次安装App,用户登录之后界面卡住,代码不往下走,也不会闪退。
还有更神奇的事情,我一个申请了三个AppId,只有其中一个有这个问题。
经过我的尝试,发现
设置卡顿监控config.blockMonitorEnable = YES;
一旦出现了 [Bugly][Info] Load 439 binary images App将卡死

2018-08-10 11:57:31.740 Sierra[1889:1157067] <Info>: [BLYLog] bugly start....
2018-08-10 11:57:31.753880+0800 Sierra[1889:1157132] [Bugly][Info] Bugly [2.5.0] started
2018-08-10 11:57:32.207306+0800 Sierra[1889:1157153] [Bugly][Info] Uninstalling signal handlers.
2018-08-10 11:57:32.213415+0800 Sierra[1889:1157154] [Bugly][Info] Processed remote strategy
2018-08-10 11:57:50.099442+0800 Sierra[1889:1157155] [Bugly][Info] Load 451 binary images

Bugly中包含hotfix字段相关

用strings检测了下bugly,发现其中包含hotfix字段,但是bugly不是把热更新的功能去掉了么?为什么还会有这样的字段?

com.tencent.bugly.hotfix.patchstrategy
com.tencent.bugly.hotfix.patchstrategyut
com.tencent.bugly.graymixedstrategy
com.tencent.bugly.hotfix.strategy
com.tencent.bugly.hotfix.strategyut
com.tencent.bugly.grayevents
com.tencent.bugly.hotfix.patchversion
......
HotfixData

watch 与bugly共用 崩溃 session:activationDidCompleteWithState:error

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BLYWCSessionDelegateInterceptor session:activationDidCompleteWithState:error:]: unrecognized selector sent to instance 0x283f26820'
*** First throw call stack:
(0x1964b3f78 0x1956ac284 0x1963c75e0 0x1964b99e4 0x1964bb750 0x1b8e1a988 0x196f53064 0x196e54368 0x196e537e8 0x196f54f9c 0x107086c44 0x1070881dc 0x10708b6d4 0x10708aacc 0x10709922c 0x107099c00 0x1960b7bd8 0x1960bddec)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Install Bugly Failed

Installing Bugly (2.4.2)

[!] Error installing Bugly
[!] /usr/bin/curl -f -L -o /var/folders/42/zw2442_s7kn6vgmd28hj08q00000gn/T/d20161121-29484-n4t7os/file.zip http://softfile.3g.qq.com/myapp/buglysdk/Bugly-2.4.2.zip --create-dirs --netrc-optional

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (56) Recv failure: Connection reset by peer

pod 'Bugly', '~> 2.5.2' 失败

Installing Bugly (2.5.2)

[!] Error installing Bugly
[!] /usr/bin/curl -f -L -o /var/folders/ld/lz_8pv2s38b_1dppbbg71wm40000gn/T/d20200420-47941-1do2ups/file.zip https://raw.githubusercontent.com/BuglyDevTeam/Bugly-iOS/master/release/Bugly-2.5.2.zip --create-dirs --netrc-optional --retry 2

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

theos项目怎么引入bugly

同标题。用第二种办法引入,会提示
AppDelegate.m:20:9: fatal error: 'Bugly/Bugly.h' file not found
#import <Bugly/Bugly.h>
^~~~~~~~~~~~~~~
1 error generated.

Memory leak

i found a memory leak when used instrument leak tool.
like this:
blycrashmanager_leak

Swift与Objective-C 看不到崩溃行数

WHProject 0x0000000102604000 + 2917280
1 WHProject _loadMessage (JCChatViewController.swift:0)
2 WHProject _init (JCChatViewController.swift:0)
3 WHProject viewDidLoad (JCChatViewController.swift:0)
4 WHProject -[_priv_NBSUIHookMatrix nbs_jump_viewDidLoad:superClass:] + 1160

iOS CPU 100%

使用 bugly,在 iOS 下,App 退后台,再回来,cpu 会出现一段时间(十秒 ~ 几十秒)的 100%,你们在做什么啊?有人能解释一下吗?

你们自动上传符号表功能都正常吗?

Showing All Messages
👎 > Host: api.bugly.qq.com

👎 > User-Agent: curl/7.54.0

👎 > Accept: /

👎 > Content-Length: 332565

👎 > Expect: 100-continue

👎 > Content-Type: multipart/form-data; boundary=------------------------9875814cd338ebb5

👎 >

👎 < HTTP/1.1 100 Continue

👎 } [956 bytes data]

👎
100 324k 0 0 100 324k 0 285k 0:00:01 0:00:01 --:--:-- 285k< HTTP/1.1 200 OK

👎 < Date: Wed, 26 Sep 2018 03:48:04 GMT

👎 < Content-Type: application/json; charset=utf-8

👎 < Content-Length: 89

👎 < Connection: keep-alive

👎 < Server: Resin/4.0.27

👎 < Set-Cookie: JSESSIONID=c73c489f-760c-4c21-bc0e-302200f569b8; Path=/; HttpOnly

👎 < Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Tue, 25-Sep-2018 03:48:03 GMT

👎 <

👎 { [89 bytes data]

👎
100 324k 100 89 100 324k 64 234k 0:00:01 0:00:01 --:--:-- 234k

👎 * Connection #0 to host api.bugly.qq.com left intact

👎 -----------------------------

👎 Bugly server response: {"rtcode":50500,"msg":"Success","data":{"reponseCode":"-1","reponseDesc":"system error"}}

👎 Error: Failed to upload the zip archive file to Bugly.

👎 --------------------------------

👎 FAILTURE - dSYM upload complete.

👎 --------------------------------

👎 Failed to upload the dSYM

👎 Please check the script and try it again.

您好, 有个小问题, 需要请教各位大神.

bugly团队, 您好! 最近我们公司的APP, 全部接入了bugly系统.
在接入bugly之前, 我们还接入了友盟统计.
但是由于友盟统计的bug数量, 明显不够, 漏掉了很多, 也不知道为什么.
所以后来又接入的bugly.

正题:
有一个崩溃, 友盟和bugly同时收集到. 看图说话.
image

然后使用DSYMTools工具直接可以读取错误的内存地址, 非常的方便.
image

这是bugly经过自动还原的堆栈信息:
image

这是bugly未还原的原始堆栈信息:
image

这里可见, 第一张图和第四张图所对应的是同一个错误. 我要如何使用这个工具找到bugly平台的错误堆栈呢?

开启 Address Sanitizer闪退

==19636==ERROR: AddressSanitizer failed to deallocate 0x20000 (131072) bytes at address 0x000119a30800
==19636==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-1001.0.46.4/src/projects/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc:62 "(("unable to unmap" && 0)) != (0)" (0x0, 0x0)
#0 0x103d830e4 in __asan::AsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/var/containers/Bundle/Application/DDF4C001-BF73-4BE7-B17E-4DC000E98BE2/uSDKGeneral.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64e+0x5b0e4)

Warning: hit breakpoint while running function, skipping commands and conditions to prevent recursion.
AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report.
(lldb) bt

  • thread #5
    • frame #0: 0x0000000103d82f9c libclang_rt.asan_ios_dynamic.dylib__asan::AsanDie() frame #1: 0x0000000103d97af4 libclang_rt.asan_ios_dynamic.dylib__sanitizer::Die() + 192
      frame #2: 0x0000000103d831a8 libclang_rt.asan_ios_dynamic.dylib__asan::AsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) + 284 frame #3: 0x0000000103d97b8c libclang_rt.asan_ios_dynamic.dylib__sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) + 120
      frame #4: 0x0000000103d93000 libclang_rt.asan_ios_dynamic.dylib__sanitizer::UnmapOrDie(void*, unsigned long) + 160 frame #5: 0x0000000103d982a0 libclang_rt.asan_ios_dynamic.dylib__sanitizer::UnsetAlternateSignalStack() + 56
      frame #6: 0x0000000103d856d8 libclang_rt.asan_ios_dynamic.dylib__asan::AsanThread::Destroy() + 96 frame #7: 0x00000001a734e3dc libsystem_pthread.dylib_pthread_tsd_cleanup + 508
      frame #8: 0x00000001a7347be8 libsystem_pthread.dylib_pthread_exit + 84 frame #9: 0x00000001a7348ef8 libsystem_pthread.dylib_pthread_wqthread_exit + 100
      frame #10: 0x00000001a7348ad0 libsystem_pthread.dylib_pthread_wqthread + 364 frame #11: 0x00000001a734edc4 libsystem_pthread.dylibstart_wqthread + 4
      (lldb) thread info -s
      thread #5: tid = 0x2b141c, 0x0000000103d82f9c libclang_rt.asan_ios_dynamic.dylib`__asan::AsanDie()

使用Xcode 10.0 beta (10L176w) iOS12 模拟器启动App崩溃

使用最新的2.5.0 下面是错误日志,请问是什么原因
0x1079524f4 <+38>: movq (%rax), %rdx 这行空指针

`-[BLYDevice cpuArch]:
    0x1079524ce <+0>:   pushq  %rbp
    0x1079524cf <+1>:   movq   %rsp, %rbp
    0x1079524d2 <+4>:   pushq  %r14
    0x1079524d4 <+6>:   pushq  %rbx
    0x1079524d5 <+7>:   movq   %rdi, %rbx
    0x1079524d8 <+10>:  movq   0xdcfd89(%rip), %r14      ; BLYDevice._cpuArch
    0x1079524df <+17>:  movq   (%rbx,%r14), %rax
    0x1079524e3 <+21>:  testq  %rax, %rax
    0x1079524e6 <+24>:  jne    0x107952523               ; <+85>
    0x1079524e8 <+26>:  callq  0x108176d36               ; symbol stub for: NXGetLocalArchInfo
    0x1079524ed <+31>:  movq   0xdc68b4(%rip), %rdi      ; (void *)0x000000010d153840: NSString
->  0x1079524f4 <+38>:  movq   (%rax), %rdx
    0x1079524f7 <+41>:  movq   0xdafe32(%rip), %rsi      ; "stringWithCString:encoding:"
    0x1079524fe <+48>:  movl   $0x4, %ecx
    0x107952503 <+53>:  callq  *0xb5aea7(%rip)           ; (void *)0x0000000112170a80: objc_msgSend
    0x107952509 <+59>:  movq   %rax, %rdi
    0x10795250c <+62>:  callq  0x10817795a               ; symbol stub for: objc_retainAutoreleasedReturnValue
    0x107952511 <+67>:  movq   (%rbx,%r14), %rdi
    0x107952515 <+71>:  movq   %rax, (%rbx,%r14)
    0x107952519 <+75>:  callq  *0xb5ae99(%rip)           ; (void *)0x000000011216dd10: objc_release
    0x10795251f <+81>:  movq   (%rbx,%r14), %rax
    0x107952523 <+85>:  testq  %rax, %rax
    0x107952526 <+88>:  leaq   0xc00f03(%rip), %rdi      ; @""
    0x10795252d <+95>:  cmovneq %rax, %rdi
    0x107952531 <+99>:  popq   %rbx
    0x107952532 <+100>: popq   %r14
    0x107952534 <+102>: popq   %rbp
    0x107952535 <+103>: jmp    0x108177954               ; symbol stub for: objc_retainAutoreleaseReturnValue

Jenkins自动上传符号表很慢平均20min

image
image
Uploading image.png…

这是一个例子,项目里面包含了十几个第三方库,仅仅这个上传就花费了2min,并且还有失败的情况,请问是不是每次上传符号表也要把第三方库的符号表也上传?
怎么解决打包上传慢的问题?
Xcode版本:11.3
还有个奇怪的现象:2019年是正常的,上传很快。2020不知道怎么了突然就慢了

bugly与aspects 共存运行即闪退

1.如果把aspects写在load方法中,那么运行就闪退

2.如果自己调用aspects 方法,那么运行一段时间之后闪退
==5313==ERROR: AddressSanitizer failed to deallocate 0x20000 (131072) bytes at address 0x000151ac8800 ==5313==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-900.0.39.2/src/projects/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc:143 "(("unable to unmap" && 0)) != (0)" (0x0, 0x0) #0 0x106f82cef in __asan::AsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/var/containers/Bundle/Application/E3174B38-2EC6-4026-99C4-A34B60D2670B/HuiZhenIPhone.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x56cef)

bugly unity IOS平台捕获C#异常不能上传

bugly unity IOS平台捕获C#异常不能上传
警告提示:
BuglyAgentV2: BuglyAgentV2 has not been initialized when call +[BuglyAgentV2 level:tag:log:]
BuglyAgentV2: BuglyAgentV2 has not been initialized when call +[BuglyAgentV2 reportException:name:message:stackTrace:userInfo:terminateApp:]

已经初始化成功:
[Bugly][Info] Bugly ver: 2.4.8 started

Bugly 与 Sentry 一起使用时无法捕获部分崩溃

Hi, 我在项目中使用了 Bugly(开发版已经提到 2.5.0)来上报应用崩溃,长期来看效果还不错 👍 。不过可惜的是官网给的客服 QQ 貌似是错误的。找了一圈,只能来这了。

当我同时使用 Sentry 时,Bugly 就没法捕获一些特定类型的崩溃。

Sentry 使用 KSCrash 来收集崩溃。从源码来看 KSCrash 是会保留先前注册的 handler 的,比如:

经过简单的测试,同时开启 Bugly 和 Sentry 报错,Bugly 可以拿到 NSException 引起的错误,但是对 POSIX 信号就不行了。此外,我还没测试 Mach 和 C++ 的异常,尚不清楚会不会也有问题。

我尝试调整 Bugly 和 KSCrash 初始化的先后顺序,不过问题依然存在。考虑到 Sentry-Cocoa 和 KSCrash 是开源项目,而 Bugly 是闭源项目,想要解决此问题只能靠贵团队的开发同学了。提前感谢!

PS:你们可能让我把 Sentry 的崩溃检测功能禁掉得了。讲真 Sentry 在错误的监控报警上比 Bugly 优秀呀。Bugly 都没有非崩溃性错误的告警。不然为什么放着已经稳定运行的 Bugly 不用,还要上 Sentry?

启动时bugly有内存泄漏的地方-V2.5.2

-[BLYCrashManager startProtectTimer]
___31-[BLYCrashManager startManager]_block_invoke
-[BLYCrashManager startManager]
-[BLYCrashManager enableModule]
-[BLYSDKManager toggleModule:enable:]
___22-[BLYSDKManager start]_block_invoke_2

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.