使用 React Native 时在 iPhone 模拟器上关闭应用程序的可靠方法
Reliable way to close an app on the iPhone Simulator while working with React Native
正如 this question 指出的那样,按两次 cmd+shift+H 或按两次主页按钮应该打开应用轮播,向上滑动应该关闭应用。
但我发现自己多次按下它,而轮播只出现了大约一半的次数。其他时候连续按 5 次会弹出。有时它只是进入主屏幕,只有当我再次进入应用程序并从那里开始时才有效。我想知道,除了求助于这种巫毒教之外,是否有可靠的方法来解决这个问题? ;-)
我正在使用 react-native storybook 如果它有意义的话:
npm run storybook
我正在开发 iPhone 6 plus 模拟器,因此 iPhone X 模拟器向上滑动对我来说不是一个选择。
来自终端:
xcrun simctl terminate [device name] [bundle id]
例如:
xcrun simctl terminate "iPhone 8 Plus" org.reactjs.native.example.layout"
或
添加到package.json:
"close": "xcrun simctl terminate \"iPhone 8 Plus\" org.reactjs.native.example.layout",
和运行:
npm run close
正如 this question 指出的那样,按两次 cmd+shift+H 或按两次主页按钮应该打开应用轮播,向上滑动应该关闭应用。
但我发现自己多次按下它,而轮播只出现了大约一半的次数。其他时候连续按 5 次会弹出。有时它只是进入主屏幕,只有当我再次进入应用程序并从那里开始时才有效。我想知道,除了求助于这种巫毒教之外,是否有可靠的方法来解决这个问题? ;-)
我正在使用 react-native storybook 如果它有意义的话:
npm run storybook
我正在开发 iPhone 6 plus 模拟器,因此 iPhone X 模拟器向上滑动对我来说不是一个选择。
来自终端:
xcrun simctl terminate [device name] [bundle id]
例如:
xcrun simctl terminate "iPhone 8 Plus" org.reactjs.native.example.layout"
或
添加到package.json:
"close": "xcrun simctl terminate \"iPhone 8 Plus\" org.reactjs.native.example.layout",
和运行:
npm run close