本文介绍了React Native BUILD SUCCEED,但“没有启动设备".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的环境:
➜ AwesomeProject 节点 --versionv6.3.0➜ AwesomeProject npm --version3.10.3➜ AwesomeProject react-native --version反应原生cli:1.0.0反应原生:0.29.0➜ AwesomeProject 守望者 --version3.0.0Xcode 7.3.1 版
我创建了在以下位置描述的 AwesomeProject
:https://facebook.github.io/react-native/docs/getting-started.html#content
然后执行:sudo react-native run-ios
这是我得到的:
...导出 SYSTEM_DEVELOPER_USR_DIR=/Applications/Xcode.app/Contents/Developer/usr导出 SYSTEM_DEVELOPER_UTILITIES_DIR=/Applications/Xcode.app/Contents/Developer/Applications/Utilities导出 SYSTEM_DOCUMENTATION_DIR=/库/文档export SYSTEM_KEXT_INSTALL_PATH=/System/Library/Extensions导出 SYSTEM_LIBRARY_DIR=/系统/库export TAPI_VERIFY_MODE=ErrorsOnly导出 TARGETED_DEVICE_FAMILY=1export TARGETNAME=AwesomeProjectexport TARGET_BUILD_DIR=/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Products/Debug-iphonesimulator导出 TARGET_DEVICE_MODEL=iPhone7,2导出 TARGET_DEVICE_OS_VERSION=9.3export TARGET_NAME=AwesomeProjectexport TARGET_TEMP_DIR=/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Intermediates/AwesomeProject.build/Debug-iphonesimulator/AwesomeProject.build导出 TEMP_DIR=/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Intermediates/AwesomeProject.build/Debug-iphonesimulator/AwesomeProject.buildexport TEMP_FILES_DIR=/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Intermediates/AwesomeProject.build/Debug-iphonesimulator/AwesomeProject.build导出 TEMP_FILE_DIR=/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Intermediates/AwesomeProject.build/Debug-iphonesimulator/AwesomeProject.build导出 TEMP_ROOT=/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Intermediatesexport TOOLCHAINS=com.apple.dt.toolchain.XcodeDefaultexport TOOLCHAIN_DIR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain导出 TREAT_MISSING_BASELINES_AS_TEST_FAILURES=NO导出 UID=0export UNLOCALIZED_RESOURCES_FOLDER_PATH=AwesomeProject.app出口 UNSTRIPPED_PRODUCT=NO导出用户=root导出 USER_APPS_DIR=/var/root/Applications导出 USER_LIBRARY_DIR=/var/root/Library导出 USE_DYNAMIC_NO_PIC=YES导出 USE_HEADERMAP=YES导出 USE_HEADER_SYMLINKS=NO出口 VALIDATE_PRODUCT=NO导出 VALID_ARCHS="i386 x86_64"导出 VERBOSE_PBXCP=NOexport VERSIONPLIST_PATH=AwesomeProject.app/version.plist导出 VERSION_INFO_BUILDER=rootexport VERSION_INFO_FILE=AwesomeProject_vers.cexport VERSION_INFO_STRING="\"@(#)PROGRAM:AwesomeProject PROJECT:AwesomeProject-\""出口 WRAPPER_EXTENSION=app导出 WRAPPER_NAME=AwesomeProject.app导出 WRAPPER_SUFFIX=.app出口 WRAP_ASSET_PACKS_IN_SEPARATE_DIRECTORIES=NO导出 XCODE_APP_SUPPORT_DIR=/Applications/Xcode.app/Contents/Developer/Library/Xcode导出 XCODE_PRODUCT_BUILD_VERSION=7D1014导出 XCODE_VERSION_ACTUAL=0731导出 XCODE_VERSION_MAJOR=0700导出 XCODE_VERSION_MINOR=0730export XPCSERVICES_FOLDER_PATH=AwesomeProject.app/XPCServices出口 YACC=yacc出口拱门=x86_64导出诊断消息长度=124出口变体=正常/bin/sh -c/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Intermediates/AwesomeProject.build/Debug-iphonesimulator/AwesomeProject.build/Script-00DD1BFF1BD5951E006B06BC.sh跳过模拟器平台的捆绑=== BUILD TARGET AwesomeProjectTests OF PROJECT AwesomeProject with CONFIGURATION Debug ===检查依赖项** 构建成功 **安装 build/Build/Products/Debug-iphonesimulator/AwesomeProject.app没有启动任何设备.启动 org.reactjs.native.example.AwesomeProject没有启动任何设备.iOS iPhone 6 模拟器只是显示黑屏.
想法?
解决方案
当点击 react-native run-ios
时,打印到控制台的第一行之一会是这样的(或类似的)
正在启动 iPhone 6 (10.0)...
- 手动启动相应的模拟器
- 转到spotlight search并开始输入模拟器
- 当聚光灯显示搜索结果时,选择模拟器应用并按 Enter
- 转到模拟器应用程序的菜单:Hardwire -> Device -> iOS 10.0 -> iPhone 6 并选择它
- 重置
- 转到模拟器应用程序的菜单:模拟器 -> 重置内容和设置...
- 重试
- 再次命令
react-native run-ios
- 再次命令
Here's my environment:
➜ AwesomeProject node --version v6.3.0 ➜ AwesomeProject npm --version 3.10.3 ➜ AwesomeProject react-native --version react-native-cli: 1.0.0 react-native: 0.29.0 ➜ AwesomeProject watchman --version 3.0.0
Xcode version 7.3.1
I created the AwesomeProject
described on: https://facebook.github.io/react-native/docs/getting-started.html#content
Then execute: sudo react-native run-ios
Here's what I'm getting:
... export SYSTEM_DEVELOPER_USR_DIR=/Applications/Xcode.app/Contents/Developer/usr export SYSTEM_DEVELOPER_UTILITIES_DIR=/Applications/Xcode.app/Contents/Developer/Applications/Utilities export SYSTEM_DOCUMENTATION_DIR=/Library/Documentation export SYSTEM_KEXT_INSTALL_PATH=/System/Library/Extensions export SYSTEM_LIBRARY_DIR=/System/Library export TAPI_VERIFY_MODE=ErrorsOnly export TARGETED_DEVICE_FAMILY=1 export TARGETNAME=AwesomeProject export TARGET_BUILD_DIR=/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Products/Debug-iphonesimulator export TARGET_DEVICE_MODEL=iPhone7,2 export TARGET_DEVICE_OS_VERSION=9.3 export TARGET_NAME=AwesomeProject export TARGET_TEMP_DIR=/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Intermediates/AwesomeProject.build/Debug-iphonesimulator/AwesomeProject.build export TEMP_DIR=/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Intermediates/AwesomeProject.build/Debug-iphonesimulator/AwesomeProject.build export TEMP_FILES_DIR=/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Intermediates/AwesomeProject.build/Debug-iphonesimulator/AwesomeProject.build export TEMP_FILE_DIR=/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Intermediates/AwesomeProject.build/Debug-iphonesimulator/AwesomeProject.build export TEMP_ROOT=/Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Intermediates export TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault export TOOLCHAIN_DIR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain export TREAT_MISSING_BASELINES_AS_TEST_FAILURES=NO export UID=0 export UNLOCALIZED_RESOURCES_FOLDER_PATH=AwesomeProject.app export UNSTRIPPED_PRODUCT=NO export USER=root export USER_APPS_DIR=/var/root/Applications export USER_LIBRARY_DIR=/var/root/Library export USE_DYNAMIC_NO_PIC=YES export USE_HEADERMAP=YES export USE_HEADER_SYMLINKS=NO export VALIDATE_PRODUCT=NO export VALID_ARCHS="i386 x86_64" export VERBOSE_PBXCP=NO export VERSIONPLIST_PATH=AwesomeProject.app/version.plist export VERSION_INFO_BUILDER=root export VERSION_INFO_FILE=AwesomeProject_vers.c export VERSION_INFO_STRING="\"@(#)PROGRAM:AwesomeProject PROJECT:AwesomeProject-\"" export WRAPPER_EXTENSION=app export WRAPPER_NAME=AwesomeProject.app export WRAPPER_SUFFIX=.app export WRAP_ASSET_PACKS_IN_SEPARATE_DIRECTORIES=NO export XCODE_APP_SUPPORT_DIR=/Applications/Xcode.app/Contents/Developer/Library/Xcode export XCODE_PRODUCT_BUILD_VERSION=7D1014 export XCODE_VERSION_ACTUAL=0731 export XCODE_VERSION_MAJOR=0700 export XCODE_VERSION_MINOR=0730 export XPCSERVICES_FOLDER_PATH=AwesomeProject.app/XPCServices export YACC=yacc export arch=x86_64 export diagnostic_message_length=124 export variant=normal /bin/sh -c /Users/glaksmono/Documents/React/AwesomeProject/ios/build/Build/Intermediates/AwesomeProject.build/Debug-iphonesimulator/AwesomeProject.build/Script-00DD1BFF1BD5951E006B06BC.sh Skipping bundling for Simulator platform === BUILD TARGET AwesomeProjectTests OF PROJECT AwesomeProject WITH CONFIGURATION Debug === Check dependencies ** BUILD SUCCEEDED ** Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.app No devices are booted. Launching org.reactjs.native.example.AwesomeProject No devices are booted.
And the iOS iPhone 6 simulator is just showing a black screen.
Ideas?
解决方案
When hitting react-native run-ios
, one of the first lines printed to console, would be something like this (or similar)
Launching iPhone 6 (10.0)...
- Boot the respective simulator manually
- Go to spotlight search and start to type simulator
- When spotlight presents the search result, choose the simulator app and hit Enter
- Go to simulator app's menu: Hardwire -> Device -> iOS 10.0 -> iPhone 6 and select it
- Reset
- Go to simulator app's menu: Simulator -> Reset Content and Settings...
- Retry
- Command
react-native run-ios
again
- Command
这篇关于React Native BUILD SUCCEED,但“没有启动设备".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!