Skip to content

Instantly share code, notes, and snippets.

@JackHowa
Created June 1, 2018 00:23
Show Gist options
  • Save JackHowa/013ece252ba03eddd857e137a4fd17c4 to your computer and use it in GitHub Desktop.
Save JackHowa/013ece252ba03eddd857e137a4fd17c4 to your computer and use it in GitHub Desktop.
this is a running list of helpful commands for react native
# see available devices for the simulator
xcrun simctl list devices
react-native run-ios --simulator="iPhone 10"
@JackHowa
Copy link
Author

JackHowa commented Jun 1, 2018

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:installDebug'.

com.android.builder.testing.api.DeviceException: No connected devices!

@JackHowa
Copy link
Author

JackHowa commented Jun 1, 2018

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...

@JackHowa
Copy link
Author

JackHowa commented Jun 1, 2018

simulator screen shot - iphone 6 - 2018-05-31 at 21 01 03
simulator screen shot - iphone x - 2018-05-31 at 21 01 00

@JackHowa
Copy link
Author

JackHowa commented Jun 1, 2018

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;

@JackHowa
Copy link
Author

JackHowa commented Jun 1, 2018

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