博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
android强制全屏_如何强制任何Android应用进入全屏浸入模式(无生根)
阅读量:2508 次
发布时间:2019-05-11

本文共 8114 字,大约阅读时间需要 27 分钟。

android强制全屏

android强制全屏

Google released an Android version of Chrome in 2012, and have never bothered to give it a fullscreen mode. If you’re tired of waiting on your favorite Android app to offer fullscreen, there’s a way to do it yourself with Immersive Mode.

Google于2012年发布了Android版本的Chrome,并且从未为它提供全屏模式。 如果您厌倦了等待自己喜欢的Android应用程序提供全屏显示,可以使用“沉浸模式”自行完成。

Come on Google, I’ve literally been begging you for years! There’s just no reason not to give us a fullscreen mode. There are ways to do this , but assuming you’ll always want to keep a specific app in fullscreen, there’s a faster and more practical way to do it using only the Android debug bridge (ADB) desktop tool.

来Google吧,我多年来一直在乞求您! 完全没有理由不给我们全屏模式。 有多种方法可以来执行此操作,但是假设您始终希望将特定应用程序保持在全屏状态,则有一种更快捷,更实用的方法来仅使用Android调试桥(ADB)桌面工具。

你需要什么 (What You’ll Need)

To follow the steps in this article, you’ll need the following:

要执行本文中的步骤,您将需要以下内容:

  • An Android phone or tablet running version 4.4 (KitKat) or later

    运行版本4.4(KitKat)或更高版本的Android手机或平板电脑
  • A PC running Windows, macOS, or Linux

    运行Windows,macOS或Linux的PC
  • A USB cable

    USB线

第一步:启用USB调试 (Step One: Enable USB debugging)

Before you begin, you’ll need to enable USB-based debugging on your phone if you haven’t already. Open the main Settings menu. Tap “About Phone,” and then tap the “Build Number” entry seven times. Yes, really. On some phones the “About Phone” entry may be somewhere else in the Settings menu, but if you poke around you should be able to find it.

在开始之前,您需要先在手机上启用基于USB的调试。 打开主设置菜单。 点击“关于电话”,然后点击“内部号码”条目七次。 对真的。 在某些手机上,“关于手机”条目可能位于“设置”菜单中的其他位置,但是如果您四处逛逛,应该可以找到它。

When you see the popup notification that says “You are now a developer,” press the Back button and you’ll see a new option in the main Settings Menu: “Developer Options.”

当您看到显示“您现在是开发人员”的弹出通知时,按“返回”按钮,您将在“设置”主菜单中看到一个新选项:“开发人员选项”。

Tap “Developer Options,” and inside you’ll find the “USB debugging” option under the Debugging heading. Enable it, and then tap “OK.”

点击“开发人员选项”,然后在“调试”标题下找到“ USB调试”选项。 启用它,然后点击“确定”。

第二步:安装Android SDK和ADB (Step Two: Install the Android SDK and ADB)

If you haven’t messed around with your phone much, you probably don’t have the Android Debug Bridge installed on your PC yet. If not, you can on how to get it up and running. Make sure you have the USB driver for your phone installed as well.

如果您还不太喜欢手机,则可能您的PC上尚未安装Android调试桥。 如果没有,您可以进行安装和运行。 确保还安装了手机的USB驱动程序。

Once you’re done with the installation, come back here and continue to the next step.

安装完成后,请回到此处继续下一步。

第三步:查找应用的APK名称 (Step Three: Find Your App’s APK Name)

In order to manually adjust an app’s settings in ADB, you’ll need to know its exact application file name, or APK name. Unfortunately, Android doesn’t make it easy to find that out with default tools. But there is an easy way to get the information on your desktop.

为了在ADB中手动调整应用程序的设置,您需要知道其确切的应用程序文件名或APK名称。 不幸的是,Android并不容易通过默认工具来发现这一点。 但是有一种简单的方法可以在桌面上获取信息。

Open any web browser and go to the Google Play Store at . Click on “Apps” in the left-hand column, then “My Apps.” This give you a list of all the Android apps you’ve installed through the Play Store.

打开任何网络浏览器,然后访问上的Google Play商店。 点击左侧栏中的“应用”,然后点击“我的应用”。 这为您提供了您通过Play商店安装的所有Android应用程序的列表。

Click the app you want. If you can’t find it immediately, you can click the “All Apps” button beneath the Search bar to narrow it down to only apps installed on one device.

点击您想要的应用。 如果您无法立即找到它,则可以单击搜索栏下方的“所有应用程序”按钮,将其范围缩小到仅安装在一台设备上的应用程序。

When you’ve reached the desired app’s Play Store page, take a look at the web address in the browser URL bar. After the “id=” identifier tag, the address will show the APK name of the app. In our example (Chrome for Android), the full address is:

到达所需应用程序的Play商店页面后,请查看浏览器URL栏中的网址。 在“ id =”标识符标签之后,该地址将显示该应用的APK名称。 在我们的示例(适用于Android的Chrome)中,完整地址为:

https://play.google.com/store/apps/details?id=com.android.chrome

And the APK name we’re looking for is “com.android.chrome.”

我们正在寻找的APK名称是“ com.android.chrome”。

Make a note of your app’s APK name before continuing.

在继续之前,记下您应用的APK名称。

第四步:验证您与ADB的设备连接 (Step Four: Verify Your Device Connection with ADB)

Next, you’ll need to open Command Prompt (in Windows) or Terminal (in macOS) and navigate to a folder named “platform-tools” where your Android SDK is installed.

接下来,您需要打开“命令提示符”(在Windows中)或“终端”(在macOS中),并导航到安装了Android SDK的名为“ platform-tools”的文件夹。

In Windows, you’ll find it at the following location:

在Windows中,您可以在以下位置找到它:

/users/your username/AppData/Local/Android/sdk/platform-tools

In macOS, it’s located at:

在macOS中,它位于:

/Users/your username/Library/Android/SDK/platform-tools

Plug your phone or tablet into the computer with your USB cable. Depending on your phone model, you may need to confirm the ADB connection on the phone itself with a pop-up message.

用USB电缆将手机或平板电脑插入计算机。 根据您的电话型号,您可能需要通过弹出消息确认电话本身的ADB连接。

At the prompt, type the following text and hit Enter

在提示符下,键入以下文本,然后按Enter

adb devices

If you see a single device line under the ADB device command, you’re ready to go. If you don’t see any devices listed, double-check that your phone or tablet is connected and that you have the drivers installed.

如果在ADB设备命令下看到单个设备行,就可以开始了。 如果没有列出任何设备,请仔细检查手机或平板电脑是否已连接以及是否已安装驱动程序。

Go ahead and leave the prompt open because you’re going to have to enter another command shortly.

继续进行操作,使提示保持打开状态,因为您将必须很快输入另一个命令。

第六步:选择沉浸式模式 (Step Six: Choose Your Immersive Mode)

There are three different kinds of fullscreen modes we can use with the immersive command.

我们可以与沉浸式命令一起使用三种全屏模式。

  • immersive.full: hides the status bar on top of the screen and the navigation bar on the bottom, if your phone uses virtual navigation buttons. This is what most people want when they think of a fullscreen app.

    immersive.full :如果您的电话使用虚拟导航按钮,则在屏幕顶部隐藏状态栏,在底部隐藏导航栏。 这就是大多数人在想到全屏应用程序时想要的。

  • immersive.status: hides only the status bar on top.

    immersive.status :仅在顶部隐藏状态栏。

  • immersive.navigation: hides only the navigation bar on the bottom.

    immersive.navigation :仅隐藏底部的导航栏。

Immersive.full (left), immersive.status (center), and immersive.navigation (right)
沉浸式(左),沉浸式(中央)和沉浸式(右)

Choose which mode you want to use before continuing. Don’t worry, you can apply the command below multiple times if you change your mind.

在继续之前,请选择要使用的模式。 不用担心,如果您改变主意,可以在下面多次应用该命令。

第六步:应用命令 (Step Six: Apply the Command)

Next, type the following text at the prompt, substituting the app name you found in Step Three after the = sign. I’ve used Chrome as my example here, but you can swap out the APK name with any other.

接下来,在提示符下键入以下文本,用您在步骤三中找到的应用名称替换为=号。 我在这里以Chrome为例,但您可以将APK名称换成其他名称。

adb shell settings put global policy_control immersive.full=com.android.chrome

This particular command enables fullscreen version of Immersive Mode for the Chrome app. To hide only the status bar or navigation bar, use the immersive.status or immersive.nagivation commands, respectively.

此特定命令可为Chrome应用启用全屏浸入模式版本。 要仅隐藏状态栏或导航栏,请分别使用immersive.status或immersive.nagivation命令。

Press Enter to execute the command. That’s it! From now on, Chrome on your phone (or any other app you input) will run in fullscreen mode. You can unplug your phone and try it now: simply swipe up or down from the bottom or top of the screen (or the side in horizontal mode) to show the navigation buttons or status bar.

按Enter执行命令。 而已! 从现在开始,您手机(或您输入的任何其他应用)上的Chrome将以全屏模式运行。 您可以拔下电话并立即尝试:只需从屏幕底部或顶部(或水平模式下的侧面)向上或向下滑动即可显示导航按钮或状态栏。

If you ever want to change the app back to its standard operation mode, simply repeat these steps, but substitute this command in Command Prompt or Terminal (again, using the APK name for your app):

如果您想将应用程序改回其标准操作模式,只需重复这些步骤,但在命令提示符或终端中再次使用此命令(同样,使用应用程序的APK名称):

adb shell settings put global policy_control immersive.off=com.android.chrome


This method should work with all standard Android devices, but some manufacturers may have modified the mobile operating system to the point where the commands aren’t valid. If it doesn’t work immediately on your phone or tablet, try unplugging your phone and plugging it back in—the ADB and driver connection can sometimes be finicky.

此方法适用于所有标准Android设备,但某些制造商可能已将移动操作系统修改为命令无效的地步。 如果无法立即在手机或平板电脑上使用它,请尝试拔下手机,然后再插回去-ADB和驱动程序的连接有时可能很困难。

翻译自:

android强制全屏

转载地址:http://bezwd.baihongyu.com/

你可能感兴趣的文章
客户汇定金过来了
查看>>
迷茫,糊涂
查看>>
风的随笔
查看>>
孤独的我
查看>>
佛教箴言181条
查看>>
佛是一棵树
查看>>
喝茶成瘾
查看>>
no body here only me
查看>>
智慧外贸语选
查看>>
独立自我安排生活的习惯--新的一天开始了
查看>>
凡人凡想
查看>>
听李阳的疯狂英语
查看>>
深圳城中村的地主和野蛮
查看>>
那时花开
查看>>
美学意境--值得研究的方向
查看>>
写给我亲爱的女友--宝贝只是一个孩子
查看>>
优秀的个人定义
查看>>
秋思--灵魂
查看>>
不要把我当外人,要把我当自己人
查看>>
委内瑞拉外汇管制
查看>>