本文整理匯總了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);
});
}