Library For Android Device Shell Tools
npm install react-native-shell-tools
import { execCommand, execAsyncCommand } from 'react-native-shell-tools';
//
// 异步用法
execAsyncCommand(`cat /sys/class/qcom-battery/soh`)
.then((res) => {
console.log('execAsyncCommand', res);
})
.catch((err) => {
console.log(err, 'execAsyncCommandErr');
});
// 同步用法
const batteryRes = execCommand(`cat /sys/class/qcom-battery/soh`)
console.log(batteryRes)
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library