1.0.0-rc-7 • Published 5 years ago
react-native-command-executor v1.0.0-rc-7
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
- 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 thegetPackages()
method
- 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')
- 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);
1.0.0-rc-7
5 years ago
1.0.0-rc-6
5 years ago
1.0.0-rc-5
5 years ago
1.0.0-rc-4
5 years ago
1.0.0-rc-3
5 years ago
1.0.0-rc-2
5 years ago
1.0.0-rc-1
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago