mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 05:53:27 +02:00
25 lines
598 B
JavaScript
25 lines
598 B
JavaScript
module.exports = function RemoteDebugCtrl($scope, $timeout) {
|
|
function startRemoteConnect() {
|
|
if ($scope.control) {
|
|
$scope.control.startRemoteConnect().then(function (result) {
|
|
var url = result.lastData
|
|
$scope.$apply(function () {
|
|
$scope.debugCommand = 'adb connect ' + url
|
|
})
|
|
})
|
|
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
// TODO: Remove timeout and fix control initialization
|
|
if (!startRemoteConnect()) {
|
|
$timeout(function () {
|
|
if (!startRemoteConnect()) {
|
|
$timeout(startRemoteConnect, 1000)
|
|
}
|
|
}, 200)
|
|
}
|
|
}
|