React-native无法打开ios模拟器调试菜单



我有一个使用ios模拟器(主要是iPhone 8)开发的react-native项目。我似乎无法使用常规命令⌘+ d打开调试菜单。

我最近开始应用pod作为在我的项目中集成依赖项的一种方式,因为我需要一个需要它的特定库。在此更改之后,我不再能够使用⌘+ D和⌘+ r等控件打开调试菜单(也不能刷新模拟器应用程序)。我还试图从模拟器顶部菜单中打开这些菜单,没有运气。握手手势也不工作,没有运气。

我运行我的应用程序的方式如下:

ENVFILE=.env.ios-development react-native run-ios --simulator 'iPhone 8'

我认为它应该解决调试模式而不是发布模式?因为有一件事可以解释为什么调试菜单不能打开,那就是应用程序处于发布模式,不支持调试菜单。但这不应该是这种情况,因为我只是用基本的react-native run-ios命令运行它。我怎么能100%确定它不是在发布模式?我可以从应用程序打开一个警报来测试它(因为console.log不会显示,因为无法进入调试菜单)。同样,一旦我启动应用程序,它在终端显示如下:

info使用"xcodebuild -workspace MyApp。MyApp -destination id=356D169E-E11E-44B2-8AEF-015D0F24A203 -derivedDataPath build/MyApp">

如果-configuration标志的值为Debug,则表示它不是在发布模式。

我的Podfile如下:

project 'MyApp.xcworkspace'
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
# Allowed sources
source 'https://github.com/CocoaPods/Specs.git'
target 'myapp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for myapp
# Point to the installed version
pod 'RNDateTimePicker', :path => '../node_modules/@react-native-community/datetimepicker/RNDateTimePicker.podspec'
# React/React-Native specific pods
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',      # Include this for RN >= 0.47
'DevSupport',     # Include this to enable In-App Devmenu if RN >= 0.43
'RCTText',
'RCTNetwork',
'RCTWebSocket',   # Needed for debugging
]
# Explicitly include Yoga if you are using RN >= 0.42.0
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
# Third party deps podspec link
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
target 'myapp-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'myappTests' do
inherit! :search_paths
# Pods for testing
end
end

可能是启用应用内调试菜单的DevSupport模块没有正确安装吗?我指的是这个:

'DevSupport',     # Include this to enable In-App Devmenu if RN >= 0.43

类似的问题我试了很多答案都没有成功。

我的反应原生版本是:0.59.10

能够通过从我的Podfile中删除use_frameworks!行来修复此问题。我想我很幸运没有在我的应用程序中使用任何动态框架,所以我能够用这个解决方案来修复它。但我知道这不是最佳选择。因此,如果有人想出一个更好的选择,我可能会接受它。

最新更新