react-native init sample-app
"sample-app" is not a valid name for a project. Please use a valid identifier name (alphanumeric).
キャメルケースのプロジェクト名で作成
react-native init reactNativeSample
iOSのエミュレーターで起動
react-native run-ios
シュミレーターを指定して起動
run-ios --simulator="iPhone SE"
最初の起動ではビルドに時間がかかるみたい、ターミナルがもう一つ起動してインストールされる
androidのエミュレーターで起動
androidの起動1回目
react-native run-android
エミュレータが起動しないエミュレータを立ち上げた状態でないとだめか?
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!
* 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: 1 mins 32.61 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: