Better way to run ADB command in grunt.
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-adb-tools --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-adb-tools');
Pushes an Android application to an emulator/device.
In your project's Gruntfile, add a section named adbInstall
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
adbInstall: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
})
No options provided.
grunt.initConfig({
adbInstall: {
someApps: {
files: [{
expand: true,
cwd: 'tmp',
src: ['*.apk']
}]
}
},
})
Removes a package from the system.
grunt.initConfig({
adbUninstall: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
})
No options provided.
grunt.initConfig({
adbUninstall: {
someApps: {
packageNames: ['com.candl.athena']
}
},
})
Copies a specified file from your development computer to an emulator/device instance.
grunt.initConfig({
adbPush: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
})
No options provided.
grunt.initConfig({
adbPush: {
someTexts: {
files: [{
expand: true,
cwd: 'tmp',
src: ['*.txt'],
dest: '/sdcard/netputer'
}]
}
},
})
Start an Activity specified by intent.
grunt.initConfig({
adbStart: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
})
No options provided.
grunt.initConfig({
adbStart: {
someApps: {
intents: [
'com.candl.athena',
'http://www.baidu.com/'
]
}
},
})
Force stop everything associated with package name.
grunt.initConfig({
adbForceStop: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
})
No options provided.
grunt.initConfig({
adbForceStop: {
someApps: {
packageNames: ['com.candl.athena']
}
},
})
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
See CHANGELOG.md.
Copyright (c) 2014 NetPuter. Licensed under the MIT license.