Skip to content

Commit

Permalink
Merge pull request #4 from macacajs/support-launch
Browse files Browse the repository at this point in the history
support launch from package name
  • Loading branch information
xudafeng committed Apr 6, 2016
2 parents ed31f91 + ccb8302 commit 0cea58d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

'use strict';

const _ = require('macaca-utils');
const macacaUtils = require('macaca-utils');

var _ = macacaUtils.merge({}, macacaUtils);

_.sleep = function(ms) {
return new Promise((resolve, reject) => {
Expand Down
9 changes: 8 additions & 1 deletion lib/macaca-android.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ Android.prototype.initDevice = function *() {
};

Android.prototype.getApkInfo = function *() {
this.apkInfo = yield ADB.getApkMainifest(this.args.app);
if (this.args.package && this.args.activity) {
this.apkInfo = {
package: this.args.package,
activity: this.args.activity
};
} else {
this.apkInfo = yield ADB.getApkMainifest(this.args.app);
}
};

Android.prototype.unlock = function *() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "macaca-android",
"version": "1.0.1",
"version": "1.0.2",
"description": "macaca android",
"keywords": [
"android"
Expand Down
4 changes: 3 additions & 1 deletion test/macaca-android.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@
var Android = require('..');

describe('test', function() {

it('should be ok', function() {
Android.should.be.ok;
});
});

0 comments on commit 0cea58d

Please sign in to comment.