运行已有项目
先初始化
安装node_modules 非常简单, 进入项目目录执行命令
npm install
运行
cd /Users/mrs.liang/Workbench/GeQing/palmscore/client_rn/Score-master
react-native run-ios
或者
react-native run-android
修改js代码后再次运行
ios模拟器,按快捷键:command+r
常用命令
adb devices #查看连接设备
问题
无法安装app到ios模拟器的问题
执行react-native run-ios命令编译成功,安装报错:
Installing build/Build/Products/Debug-iphonesimulator/Score.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/Score.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
解决方式:
执行如下命令:
react-native upgrade
react-native run-ios