react-native-command-executor

1.0.0-rc-7 • Public • Published

react-native-command-executor

Getting started

$ npm install react-native-command-executor --save

Mostly automatic installation

$ react-native link react-native-command-executor

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.imokhles.sncommandexecutor.SNCommandExecutorPackage; to the imports at the top of the file
  • Add new SNCommandExecutorPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-command-executor'
    project(':react-native-command-executor').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-command-executor/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-command-executor')
    

Usage

import SNCommandExecutor from 'react-native-command-executor';

// Check Root status
SNCommandExecutor.verifyRootStatus((value) => {
    console.log('root status: '+value);
});

// execute command
let executed = SNCommandExecutor.executeCommand("which su");
console.log('Executed: '+ executed);

Readme

Keywords

Package Sidebar

Install

npm i react-native-command-executor

Weekly Downloads

12

Version

1.0.0-rc-7

License

MIT

Unpacked Size

5.73 kB

Total Files

8

Last publish

Collaborators

  • imokhles