本文整理汇总了TypeScript中serial_commander.run_command函数的典型用法代码示例。如果您正苦于以下问题:TypeScript run_command函数的具体用法?TypeScript run_command怎么用?TypeScript run_command使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run_command函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: install_apk
export function install_apk(aPath: string, aCb: (err: any) => void) {
serial_commander.run_command('pm install ' + aPath, function(line) {
}, function(errLine) {
console.error(errLine);
}, function(exitCode) {
aCb(exitCode);
});
}
示例2: function
series.push(function(done) {
serial_commander.run_command('logcat -c', function() {
}, function(errLine) {
console.error(errLine);
}, function(exitCode) {
done(exitCode);
});
});
示例3: template
export function template(aPath: string, aCb: (err: any) => void) {
serial_commander.run_command('ll ' + aPath, function(line) {
console.log(line);
}, function(errLine) {
console.error(errLine);
}, function(exitCode) {
console.log('finished: ', exitCode);
aCb(exitCode);
});
}
示例4: debug_run_command
export function debug_run_command(aCommand, aCb: (err: any) => void) {
console.log('debug_run_command: ' + aCommand);
serial_commander.run_command(aCommand, function(line) {
console.log('O: ' + line);
}, function(errLine) {
console.log('E: ' + errLine);
}, function(exitCode) {
console.log('F: ' + exitCode);
aCb(exitCode);
});
}
示例5: get_file
export function get_file(aPathSource: string, aPathTarget: string, aCb: (err: any) => void) {
var base64string = '';
serial_commander.run_command('cat ' + aPathSource + ' | base64', function(line) {
base64string += line;
}, function(errLine) {
console.error(errLine);
}, function(exitCode) {
var buf = new Buffer(base64string, 'base64');
fs.writeFile(aPathTarget, buf, function(err) {
aCb(err);
});
});
}
示例6: pm_list_features
export function pm_list_features(aCb: (err: any, feature_list: string[]) => void) {
var re = /feature:(.*)/;
var result: string[] = [];
serial_commander.run_command('pm list features', function(line) {
var match = re.exec(line);
if (match) {
result.push(match[1]);
}
}, function(errLine) {
console.error(errLine);
}, function(exitCode) {
aCb(exitCode, result);
});
}
示例7: pm_list_packages
export function pm_list_packages(aCb: (err: any, result: TPackageInfo[]) => void) {
var re = /package:(.*)=(.*)/;
var result: TPackageInfo[] = [];
serial_commander.run_command('pm list packages', function(line) {
var match = re.exec(line);
if (match) {
result.push({
apk_path: match[1],
package_name: match[2]
});
}
}, function(errLine) {
console.error(errLine);
}, function(exitCode) {
aCb(exitCode, result);
});
}
示例8: pm_list_instrumentation
export function pm_list_instrumentation(aCb: (err: any, instrumentation_info_list: TInstrumentationInfo[]) => void) {
var re = /instrumentation:(.*)\/(.*) \(target=(.*)/;
var result: TInstrumentationInfo[] = [];
serial_commander.run_command('pm list instrumentation', function(line) {
var match = re.exec(line);
if (match) {
result.push({
package_name: match[1],
runner: match[2],
target: match[3]
});
}
}, function(errLine) {
console.error(errLine);
}, function(exitCode) {
aCb(exitCode, result);
});
}