expo go官网:
安装脚手架:
yarn global add expo-cli
创建项目并启动:
expo init my-app
cd my-app
yarn start
expo 开发者工具:
手机下载调试软件:
保证手机和电脑在同一个局域网中用苹果手机的照相机扫描expo开发者工具中的二维码即可:
代码:
在电脑安装安卓模拟调试:
android-studio下载并安装:
https://android-studio.en.softonic.com/
下载:android-sdk_r24.4.1-windows.zip
App.js:
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<Text style={
{color: "red", fontSize: 50}}>hello,world!</Text>
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});