【发布时间】:2016-01-09 15:19:34
【问题描述】:
我为 Apple Watch 更新了我的应用程序,但我应该过分称重它,现在它肯定很慢。 我无法理解这种减速的原因,所以我想调试应用程序,但我不知道该怎么做,因为在模拟器应用程序中正常运行,减速仅在设备上表现出来。
我尝试在 Watch 上直接从 xCode 运行应用程序,但是一旦 xCode 在 Watch 上启动应用程序的安装,它就会停止运行,因此我无法看到运行时发生的情况(例如,当运行某个断点或以其他方式运行时)调试)。
有没有人知道在物理 Apple Watch 上调试的正确方法是什么?
P.S.:例如这段代码:
func clearScreen() {
firstPicker.setSelectedItemIndex(0)
secondPicker.setSelectedItemIndex(0)
defaultLabels()
}
func defaultLabels() {
feesLabel.setText(NSLocalizedString ("FEES", comment: "Commissioni"))
clearAllMenuItems()
addMenuItemWithItemIcon(.Decline, title: NSLocalizedString("CAN_CEL", comment: ""), action: "clearScreen")
if DefaultParameter.sharedInstance.wishMode == true {
addMenuItemWithImage(UIImage(named: "will")! , title: NSLocalizedString("WILL_RECEIVE", comment: ""), action: "willWishButtonPressed")
receivedLabel.setText(NSLocalizedString ("DESIRED_AMOUNT", comment: ""))
} else {
addMenuItemWithImage(UIImage(named: "wish")! , title: NSLocalizedString("WISH_RECEIVE", comment: ""), action: "willWishButtonPressed")
receivedLabel.setText(NSLocalizedString ("RECEIVED_AMOUNT", comment: ""))
}
}
运行大约需要 7 秒...
【问题讨论】:
标签: ios xcode debugging watchkit apple-watch