Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25167] Hyperloop: iOS - Debugging not working reliably with Studio

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sHyperloop 2.1.3
Fix Version/sn/a
ComponentsHyperloop, iOS
Labelsn/a
ReporterJan Vennemann
AssigneeUnknown
Created2017-08-14T11:59:29.000+0000
Updated2018-02-28T19:55:30.000+0000

Description

*Steps to reproduce the behavior*

Create a default Alloy app

Replace the content in app/controllers/index.js with the following:

function doClick(e) {
	alert($.label.text);
}

var UIButton = require('UIKit/UIButton');
var UIColor = require('UIKit/UIColor');
var UIControlStateNormal = require("UIKit").UIControlStateNormal;
var UIControlEventTouchUpInside = require("UIKit").UIControlEventTouchUpInside;
var CGRectMake = require('CoreGraphics').CGRectMake;
var button = UIButton.alloc().initWithFrame(CGRectMake(20, 20, 100, 50));
button.setTitleColorForState(UIColor.blueColor, UIControlStateNormal);
button.setTitleForState('CLICK ME!', UIControlStateNormal);
var ButtonActionHandler = Hyperloop.defineClass('ButtonActionHandler', 'NSObject');
ButtonActionHandler.addMethod({
	selector: 'didPressButton:',
	arguments: ['UIButton'],
	callback: function(sender) {
		alert('Button pressed!'); // Set breakpoint here
	}
});
handler = new ButtonActionHandler();
button.addTargetActionForControlEvents(handler, 'didPressButton:', UIControlEventTouchUpInside);
$.index.add(button);

$.index.open(); // Set breakpoint here

Place the breakpoints and launch the app in debug mode

*Actual behavior* The second breakpoints gets hit every now and then, but not reliably. The first breakpoint in the button on click handler never gets hit. *Expected behavior* The debugger stops at the breakpoints *Additional notes* This is probably caused by file modifications Hyperloop does throughout the build. As a workaround it is possible to debug using the Safari Web Inspector as described [here](https://shockoe.com/blog/debugging-titanium-applications-using-safari-web-inspector/).

Comments

No comments

JSON Source