Skip to content

netputer/grunt-adb-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-adb-tools

Better way to run ADB command in grunt.

Getting Started

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');

The "adbInstall" task

Overview

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.
    },
  },
})

Options

No options provided.

Usage Examples

grunt.initConfig({
  adbInstall: {
    someApps: {
      files: [{
        expand: true,
        cwd: 'tmp',
        src: ['*.apk']
      }]
    }
  },
})

The "adbUninstall" task

Overview

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.
    },
  },
})

Options

No options provided.

Usage Examples

grunt.initConfig({
  adbUninstall: {
    someApps: {
      packageNames: ['com.candl.athena']
    }
  },
})

The "adbPush" task

Overview

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.
    },
  },
})

Options

No options provided.

Usage Examples

grunt.initConfig({
  adbPush: {
    someTexts: {
      files: [{
        expand: true,
        cwd: 'tmp',
        src: ['*.txt'],
        dest: '/sdcard/netputer'
      }]
    }
  },
})

The "adbStart" task

Overview

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.
    },
  },
})

Options

No options provided.

Usage Examples

grunt.initConfig({
  adbStart: {
    someApps: {
      intents: [
        'com.candl.athena',
        'http://www.baidu.com/'
      ]
    }
  },
})

The "adbForceStop" task

Overview

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.
    },
  },
})

Options

No options provided.

Usage Examples

grunt.initConfig({
  adbForceStop: {
    someApps: {
      packageNames: ['com.candl.athena']
    }
  },
})

Contributing

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.

Release History

See CHANGELOG.md.

License

Copyright (c) 2014 NetPuter. Licensed under the MIT license.

About

Better way to run ADB command in grunt.

Resources

License

Stars

Watchers

Forks

Packages

No packages published