Skip to content

This module for execute shell android, use command and execute shell

License

Notifications You must be signed in to change notification settings

jeffer80/react-native-android-shell

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-android-shell

This module for execute shell android, use command and execute shell

Screenshot

Alt text Alt text Alt text

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;

About

This module for execute shell android, use command and execute shell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 39.0%
  • Ruby 21.6%
  • Objective-C 17.9%
  • JavaScript 13.7%
  • Starlark 7.8%