使用内置 MonkeyTalk 最小化应用程序时 iOS 应用程序崩溃

Posted

技术标签:

【中文标题】使用内置 MonkeyTalk 最小化应用程序时 iOS 应用程序崩溃【英文标题】:iOS App Crashes When App is Minimized with MonkeyTalk Built In 【发布时间】:2014-04-28 14:56:09 【问题描述】:

我使用的是 Monkey Talk 2.0.3.a 版

我已将 MonkeyTalk 集成到我的 iPhone 应用程序中,在设备和模拟器上一切正常。

但我发现应用在最小化或按下主页按钮时(即应用被发送到后台时)会崩溃。

我有另一个没有 MonkeyTalk 的相同应用程序版本,它没有集成 MonkeyTalk 并且不会发生这种崩溃,所以加入 MonkeyTalk 会导致它崩溃。

当我通过 Xcode 调试器和日志记录运行它时,我可以看到,当应用程序被发送到后台时,MonkeyTalk 中的某些内容出现了故障(它只显示了它出现故障的汇编代码)。

如果有人对正在发生的事情或为什么会发生这种情况有任何见解,我将不胜感激!

Stack Trace :

Incident Identifier: CA1FB909-46AC-45AB-9DFE-62F7D7A60B30  
CrashReporter Key:   29e221ff825afca768fe1cba2cf6aea7ac922060  
Hardware Model:      iPhone5,2  
Process:             AppName MonkeyTalkcopy [5269]  
Path:                /var/mobile/Applications/4430DBD0-10DA-4F61-B20D-9424C6F760AD/AppName MonkeyTalkcopy.app/AppName MonkeyTalkcopy   
Identifier:          se.appName.test  
Version:             1.9.9 (1.9.9)  
Code Type:           ARM (Native)  
Parent Process:      launchd [1]  

Date/Time:           2014-04-29 11:49:13.872 +0530  
OS Version:          ios 7.1 (11D167)  
Report Version:      104  

Exception Type:  00000020  
Exception Codes: 0x000000008badf00d  
Highlighted Thread:  0  

Application Specific Information:
se.appName.test failed to resume in time

Elapsed total CPU time (seconds): 13.510 (user 13.510, system 0.000), 56% CPU   
Elapsed application CPU time (seconds): 6.379, 27% CPU  

Thread 0:  
0   libsystem_platform.dylib        0x3a7636f8 _sigtramp + 0  
1   ???                             0x00356a7c 0 + 3500668
2   AppName MonkeyTalkcopy          0x0011b260 -[UIApplication(MTReady)    mtApplicationDidEnterBackground:] (UIApplication+MTReady.m:95)
3   UIKit                           0x3226950c -[UIApplication _handleApplicationSuspend:eventInfo:] + 876
4   UIKit                           0x321eb22e -[UIApplication handleEvent:withNewEvent:] + 886
5   UIKit                           0x321eadf4 -[UIApplication sendEvent:] + 68
6   AppName MonkeyTalkcopy          0x0011b3b8 -[UIApplication(MTReady) mtSendEvent:] (UIApplication+MTReady.m:108)
7   UIKit                           0x3224f400 _UIApplicationHandleEvent + 612
8   GraphicsServices                0x34858b52 _PurpleEventCallback + 606
9   GraphicsServices                0x3485873a PurpleEventCallback + 30
10  CoreFoundation                  0x2f98183c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
11  CoreFoundation                  0x2f9817d6 __CFRunLoopDoSource1 + 342
12  CoreFoundation                  0x2f97ffa2 __CFRunLoopRun + 1402
13  CoreFoundation                  0x2f8ea7a4 CFRunLoopRunSpecific + 520
14  CoreFoundation                  0x2f8ea586 CFRunLoopRunInMode + 102
15  GraphicsServices                0x348576ce GSEventRunModal + 134
16  UIKit                           0x3224988c UIApplicationMain + 1132
17  AppName MonkeyTalkcopy          0x0000dd5a main (main.m:16)
18  AppName MonkeyTalkcopy          0x0000d164 start + 36

Thread 1:
0   libsystem_kernel.dylib          0x3a6ed804 kevent64 + 24
1   libdispatch.dylib               0x3a63c050 _dispatch_mgr_invoke + 228
2   libdispatch.dylib               0x3a6362de _dispatch_mgr_thread + 34

Thread 2 name:  WebThread
Thread 2:
0   libsystem_kernel.dylib          0x3a6eda50 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x3a6ed848 mach_msg + 36
2   CoreFoundation                  0x2f98161c __CFRunLoopServiceMachPort + 152
3   CoreFoundation                  0x2f97fd3c __CFRunLoopRun + 788
4   CoreFoundation                  0x2f8ea7a4 CFRunLoopRunSpecific + 520
5   CoreFoundation                  0x2f8ea586 CFRunLoopRunInMode + 102
6   WebCore                         0x37c1bee0 RunWebThread(void*) + 416
7   libsystem_pthread.dylib         0x3a767956 _pthread_body + 138
8   libsystem_pthread.dylib         0x3a7678c6 _pthread_start + 98
9   libsystem_pthread.dylib         0x3a765ae4 thread_start + 4

Thread 3:
0   libsystem_kernel.dylib          0x3a700c70 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x3a765c1e _pthread_wqthread + 306
2   libsystem_pthread.dylib         0x3a765ad8 start_wqthread + 4

【问题讨论】:

【参考方案1】:

问题已通过升级到最新版本的 MonkeyTalk v2.0.4

解决

https://www.cloudmonkeymobile.com/monkeytalk-documentation/whats-new

Bug Fixes

iOS agent:
    Crash when application is sent into background

在新的 MonkeyTalk 版本 V2.0.4 中解决了最小化或按下主页按钮(应用发送到后台)导致的应用崩溃。

但是现在在设备/模拟器中录制或执行时,触摸事件中应用程序崩溃还有一个问题

在 iphone 设备/模拟器中,当我尝试在我的应用中记录带有触摸事件的操作时,它会崩溃。此外,当我在执行触摸事件时尝试使用录制的脚本时,它会使应用程序崩溃。以下是我的崩溃报告。

Incident Identifier: 5F4C1528-D282-41BE-95B4-15F059CC37BE
CrashReporter Key:   29e221ff825afca768fe1cba2cf6aea7ac922060
Hardware Model:      iPhone5,2
Process:             App copy [5567]
Path:                /var/mobile/Applications/E7177F26-8A2C-4B1D-87FD-3D99A4A7D1DD/APP copy.app/APP copy
Identifier:          se.AppName.timereport
Version:             2.0.0 (2.0.0)
Code Type:           ARM (Native)
Parent Process:      launchd [1]

Date/Time:           2014-04-29 17:26:12.393 +0530
OS Version:          iOS 7.1 (11D167)
Report Version:      104

Exception Type:  00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread:  0

Application Specific Information: se.AppName.timereport failed to exit in time

Elapsed total CPU time (seconds): 7.690 (user 7.690, system 0.000), 61% CPU 
Elapsed application CPU time (seconds): 3.366, 27% CPU

Thread 0:
0   libsystem_platform.dylib        0x3a7636f8 _sigtramp + 0
1   APP copy                0x0022ffd2 -[UIView(MTReady) propertyName:parent:]  (UIView+MTReady.m:643)
2   APP copy                0x00230144 -[UIView(MTReady) iVarName] (UIView+MTReady.m:660)
3   APP copy                0x0022f822 -[UIView(MTReady) rawMonkeyIDCandidates] (UIView+MTReady.m:578)
4   APP copy                0x00230ac2 -[UIView(MTReady) baseMonkeyID] (UIView+MTReady.m:755)
5   APP copy                0x0022fb3c -[UIView(MTReady) monkeyID] (UIView+MTReady.m:609)
6   APP copy                0x0022bf24 -[UIView(MTReady) handleMonkeyTouchEvent:withEvent:] (UIView+MTReady.m:220)
7   APP copy                0x0021a608 -[MonkeyTalk handleEvent:] (MonkeyTalk.m:609)
8   APP copy                0x0022965e -[UIApplication(MTReady) mtSendEvent:] (UIApplication+MTReady.m:100)
9   UIKit                           0x321e953c _UIApplicationHandleEventQueue + 7116
10  CoreFoundation                  0x2f981fe4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
11  CoreFoundation                  0x2f9814aa __CFRunLoopDoSources0 + 202
12  CoreFoundation                  0x2f97fc9a __CFRunLoopRun + 626
13  CoreFoundation                  0x2f8ea7a4 CFRunLoopRunSpecific + 520
14  CoreFoundation                  0x2f8ea586 CFRunLoopRunInMode + 102
15  GraphicsServices                0x348576ce GSEventRunModal + 134
16  UIKit                           0x3224988c UIApplicationMain + 1132
17  APP copy                0x0004dc64 main (main.m:16)
18  App copy                0x0004c87c start + 36

任何解决此问题的帮助都会非常有用

【讨论】:

以上是关于使用内置 MonkeyTalk 最小化应用程序时 iOS 应用程序崩溃的主要内容,如果未能解决你的问题,请参考以下文章

MonkeyTalk 布尔逻辑

MonkeyTalk 无法识别 UITextfield 输入事件 [关闭]

vb 内置浏览器 如何模拟鼠标操作

具有内置多处理功能的 PySide2

内置函数的使用

python编写程序求两个数的平方和