Created
June 1, 2018 00:23
-
-
Save JackHowa/013ece252ba03eddd857e137a4fd17c4 to your computer and use it in GitHub Desktop.
this is a running list of helpful commands for react native
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see available devices for the simulator | |
xcrun simctl list devices | |
react-native run-ios --simulator="iPhone 10" |
read the error! if not found
Scanning folders for symlinks in /Users/jackhowa/sites/latr_v2/node_modules (20ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 7.501 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':app:installDebug'.
com.android.builder.testing.api.DeviceException: No connected devices!
Installing APK 'app-debug.apk' on 'Pixel_XL_API_23(AVD) - 6.0' for app:debug
Installed on 1 device.
BUILD SUCCESSFUL
Total time: 14.287 secs
This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html
/bin/sh: adb: command not found
Starting the app (adb shell am start -n com.latr_v2/com.latr_v2.MainActivity...
import React from 'react';
import { Text, View } from 'react-native';
import CompanyLogo from './src/components/CompanyLogo';
const App = () => {
const { textStyle, viewStyle } = styles;
return (
<View style={viewStyle}>
<CompanyLogo />
<Text style={textStyle}>Hey there</Text>
</View>);
}
const styles = {
textStyle: {
color: "#000000",
width: 50,
height: 50,
backgroundColor: "white"
},
viewStyle: {
height: 100,
backgroundColor: "#ef5350",
justifyContent: "space-between",
alignItems: "flex-start",
flexDirection: "row",
flex: 1,
paddingTop: 45
}
}
export default App;
import React from 'react';
import { View, Text } from 'react-native';
const CompanyLogo = () => {
const { viewStyle } = styles;
return (
<View style={viewStyle}>
<Text>Logo Here</Text>
</View>);
};
const styles = {
viewStyle: {
width: 50,
height: 50
}
}
export default CompanyLogo;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
react native for android
https://facebook.github.io/react-native/docs/getting-started.html
runs from index.js every time -- not app.js