以编程方式/命令打开iOS开发者菜单 [英] Open iOS Developer Menu programmatically / command

查看:37
本文介绍了以编程方式/命令打开iOS开发者菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这并不是一个严重的错误,但是我总是在工作时在办公桌前摇晃手机感到奇怪,尤其是在第一次不工作时.如果我们开始谈论动摇iPad Pro,那就感觉不对.

This isn't exactly a critical bug, but I always feel weird shaking phones at my desk at work, even more so when it doesn't work first time. If we start talking about shaking iPad Pros, it just feels wrong.

在Android上,我可以运行以下命令: adb shell输入keyevent KEYCODE_MENU

On Android, I can run the following command: adb shell input keyevent KEYCODE_MENU

是否有与iOS相当的产品?

Is there an iOS equivalent?

谢谢

推荐答案

不幸的是.

您可以在这里.这不是理想的,但应该可以.(下面粘贴的代码副本)

You can vote for it on Canny here. Until then, your best bet for iOS is to use a workaround such as one of the ones suggested from the original Github issue. For example, creating your own multi-touch shortcut for opening the dev menu as seen here. It's not ideal but it should work. (code copy pasted below)

import React from 'react';
import {
  View,
  PanResponder,
  NativeModules,
}            from 'react-native';


const DevMenuTrigger = ({children}) => {
  const {DevMenu} = NativeModules;
  const panResponder = PanResponder.create({
    onStartShouldSetPanResponder: (evt, gestureState) => {
      if (gestureState.numberActiveTouches === 3) {
        DevMenu.show();
      }
    },
  });
  return <View style={{flex: 1}} {...panResponder.panHandlers}>{children}</View>;
};


...

AppRegistry.registerComponent('myApp', (): any => <DevMenuTrigger><MyApp></DevMenuTrigger>

这篇关于以编程方式/命令打开iOS开发者菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆