react-native-android-root-shell
v0.0.1
Published
This module for execute shell android, use command and execute shell
Downloads
4
Maintainers
Readme
react-native-android-shell
This module for execute shell android, use command and execute shell
Screenshot
Getting started
$ npm install react-native-android-shell --save
Usage
import AndroidShell from 'react-native-android-shell';
// TODO: What to do with the module?
AndroidShell.executeCommand('your Command', (result) => {
console.log(result)
});
Example
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import AndroidShell from 'react-native-android-shell'
class demo extends Component {
constructor(props) {
super(props);
this.state = {
result: ''
};
}
componentDidMount() {
AndroidShell.executeCommand("ls", (result) => {
this.setState({ result: 'yeu : ' + result });
console.log('Result :', result);
});
}
render() {
return (
<View style={{alignItems: 'center', flex: 1 }}>
<Text>{this.state.result}</Text>
</View>
);
}
}
export default demo;