类别列中的图标是什么意思?
我想补充一个关于Xcode Instruments 7.2更现代的UI的问题.该图像是"时间分析工具详细信息"窗格的一部分,特别是"调用树选择"输出.第二个图像底部的图标是什么,看起来像一个有3个窗口的房子后面跟一个十六进制数字?此图标也位于旧的Instruments UI中(上面的灰色突出显示).这可能是不可用的符号吗?
我是iOS中的新手.我试图找到仪器中的内存泄漏并使用Xcode 4.5.2并遵循本教程:http://soulwithmobiletechnology.blogspot.sg/2011/04/how-to-check-memory-leaks-in-xcode-4 .html.
我能够找到内存泄漏并能够按箭头转到内存泄漏项的历史记录.但是,当我双击其中任何一个时,它不会显示导致内存泄漏的行.
图像是这样的:
我究竟做错了什么?需要一些指导...谢谢..
我使用以下命令在应用程序(不是模拟器)上启动我的iOS应用程序(已经安装了应用程序).
instruments \
-w c717fa22472d7b691ae5763af90e1e44244ad85a \
-t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate \
-D "/Users/mj/Desktop/apps/trace" \
LPSimpleExample-cal \
-e UIARESULTSPATH /Users/mj/Desktop/apps \
-e UIASCRIPT /Users/mj/Desktop/apps/_run_loop.js
Run Code Online (Sandbox Code Playgroud)
它正在工作的10次中有6次.如果出现错误,我会收到以下消息:
2013-10-07 16:45:51.553 instruments[9891:1207] unable to locate CFBundleIdentifier for path: LPSimpleExample-cal
2013-10-07 16:45:51.555 instruments[9891:1207] Recording cancelled : At least one target failed to launch; aborting run
Instruments Trace Error : Error Domain=com.apple.instruments Code=1 "Error Starting Recording" UserInfo=0x7faccbef8fa0 {NSLocalizedDescription=Error Starting Recording, NSLocalizedRecoverySuggestion=At least one target failed to launch; aborting run}
Instruments Trace Error : Failed to start trace.
Run Code Online (Sandbox Code Playgroud)
对我来说,看起来仪器有一个错误.我试图在不同的情况下启动应用程序超过100次,我无法分析错误模式.设备崩溃日志说:
Process: …
Run Code Online (Sandbox Code Playgroud) XCode 6.1.1仪器6.1
可以在Simulator上使用Counters模板,但不能在设备上使用.获取警告/错误消息:
"The current OS does not have support for your CPU"
Run Code Online (Sandbox Code Playgroud)
红色按钮显示为灰色,无法启动会话.
只能在模拟器上运行计数器?
这是来自XCode PRODUCT/PROFILE,目标是设备,而不是模拟器.
iPhone 4和iPad Mini都出现了这个问题.
我使用XCTest在Xcode中编写了单元测试,并且它们在Xcode 中运行良好.除了GUI环境,我还有一个makefile,可以从命令行自动执行某些进程.这些包括构建,测试,清理,分析等.其基本原理是在构建管道中包含脚本,主要用于夜间构建.有了这个,我们会在早上获得构建,性能报告,内存泄漏等等.
instruments -t "Allocations" -D build/hul.trace hul.xcodeproj
Run Code Online (Sandbox Code Playgroud)
我得到以下输出:
Instruments Trace Error : Target failed to run: Unable to find actual binary to posix_spawn for path: hul.xcodeproj
Run Code Online (Sandbox Code Playgroud)
这与项目是静态库有关吗?我想要将结果写入文件的工具,以便我可以在第二天进行咨询,甚至自动执行某些处理,例如使用模式匹配.有没有人在使用仪器之前做过这样的事情?
编辑:这似乎做了一些事情:
sudo instruments -v -t "Time Profiler" "build/Build/Products/Debug-iphonesimulator/hulTests.xctest/" -w "iPhone SE"
Run Code Online (Sandbox Code Playgroud)
但是,我得到以下对话框:
我只是不知道适当的行动是什么......
编辑:有一件事是错的.根据文件:
-w [hardware device, or simulator name]
The name or identifier of the hardware device or simulator to target. Should be specified first
Run Code Online (Sandbox Code Playgroud)
所以上一行改为:
instruments -w …
Run Code Online (Sandbox Code Playgroud) 当我用xCode运行我的应用程序时,所有加载并运行正常.当我加载仪器并使用活动监视器或分配的分析模板按记录时,它会加载并运行正常.但是,如果我使用Zombies或Leaks,应用程序会立即崩溃.我甚至都看不到它.然后我访问xcode中的崩溃日志,虽然崩溃的原因是异常类型:EXC_BAD_ACCESS(SIGSEGV)
由于每个报告都不同,因此几乎不可能调试原因.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000010
VM Region Info: 0x10 is not in any region. Bytes before following region: 4297687024
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 0000000100298000-0000000100388000 [ 960K] r-x/r-x SM=COW ...p/MyApp
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 …
Run Code Online (Sandbox Code Playgroud) 尝试跟踪Xcode Instruments中的内存泄漏时,我经常在Stack Trance中看到以下行:
thunk for @escaping @callee_guaranteed () -> ()
Run Code Online (Sandbox Code Playgroud)
这是什么意思?在这种情况下,我什至无法翻译粗俗的单词,更不用说它的技术含义了。完整的堆栈跟踪如下所示:
0 libsystem_malloc.dylib calloc
1 libobjc.A.dylib weak_resize(weak_table_t*, unsigned long)
2 libobjc.A.dylib weak_register_no_lock
3 libobjc.A.dylib objc_storeWeak
4 SpriteKit -[SKNode(setParent) setParent:]
5 SpriteKit -[SKNode insertChild:atIndex:]
6 SpriteKit -[SKNode addChild:]
7 IOSTest PieceNode.setup() /.../PieceNode.swift:66
8 IOSTest LabeledPieceNode.setup() /.../PieceNode.swift:86
9 IOSTest closure #1 in closure #1 in MaskedRectBoardNodeController.maskedRectBoard(_:didFill:with:alongGravity:) /.../MaskedRectBoardNodeController.swift:48
10 IOSTest thunk for @escaping @callee_guaranteed () -> () /.../<compiler-generated>:0
11 libdispatch.dylib _dispatch_call_block_and_release
12 libdispatch.dylib _dispatch_client_callout
13 libdispatch.dylib _dispatch_main_queue_callback_4CF$VARIANT$mp
14 CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
15 …
Run Code Online (Sandbox Code Playgroud) 在XCode Instruments应用程序中,有一个Core Data Saving仪器.它可以显示每个Core Data保存的"保存持续时间".它用于保存持续时间的单位是多少?由于没有人类可察觉的滞后时间,我看到读数从67到6343不等.
这是微秒,与处理器周期有关的东西,还是仪器采样时间的倍数?
xcode ×5
instruments ×4
ios ×3
core-data ×1
ios6 ×1
ios7 ×1
macos ×1
memory-leaks ×1
profiling ×1
swift ×1
syntax ×1
unit-testing ×1
watchkit ×1
xcode6 ×1
xcode9 ×1