
chromebook刷機

Android apps?are a great way to expand the sometimes limited capabilities of Chromebooks, but they can be a problem if you store most of your data on an external medium—like an SD card, for example.
Android應用程序是擴展Chromebook有時有限功能的好方法,但是如果您將大多數數據存儲在外部介質(例如SD卡)上,則可能會成為問題。
Fortunately, with a few commands you can actually “force” Android apps to not only see external storage, but write to it as well. I will warn you, though: this does require a few shell commands, so if you’re not comfortable with that, tread carefully. Shout out to?Nolirium for this incredibly helpful blog post that that got me rolling with this. Thanks to the guidance found there, I was able to get this this working without issue.
幸運的是,實際上,您可以使用一些命令來“強制” Android應用程序不僅查看外部存儲,還可以對其進行寫入。 不過,我會警告您:這確實需要一些shell命令,因此,如果您對此感到不滿意,請小心操作。 向Nolirium大喊,獲得這篇非常有用的博客文章,這使我對此頗為關注。 多虧了那里的指導,我才能夠毫無問題地完成這項工作。
那么,這如何工作? (So, How Does This Work?)
In short, we’ll be using bind mounts to basically “tether” a folder on the external medium to one that’s part of the internal file structure. Basically, this allows Android see the contents of the external folder, because it’s linked to a folder on the internal storage, which it can see without problems.
簡而言之,我們將使用綁定安裝將外部介質上的文件夾基本上“綁定”到內部文件結構的一部分。 基本上,這使Android可以查看外部文件夾的內容,因為它已鏈接到內部存儲設備上的文件夾,可以毫無問題地看到該文件夾??。
It’s worth noting that binding these folders will only work in Android—it won’t affect how Chrome OS sees the folders or the files within. We’re going to create a folder called “Bound” in the root of the Downloads directory in Chrome OS and bind a folder on the external medium to this folder, and while Android will see the contents of the external folder in the Bound directory, Chrome OS will not—the Bound directly will look completely empty. But since Chrome OS can natively interact with external storage, this shouldn’t be an issue.
值得注意的是,綁定這些文件夾僅在Android中有效-不會影響Chrome操作系統查看文件夾或其中的文件的方式。 我們將在Chrome操作系統的Downloads目錄的根目錄中創建一個名為“ Bound”的文件夾,并將外部媒體上的文件夾綁定到該文件夾??,而Android會在Bound目錄中看到外部文件夾的內容, Chrome操作系統不會—直接綁定的外觀將完全空白。 但是由于Chrome操作系統可以與外部存儲進行本地交互,所以這不是問題。
第一步:創建文件夾 (Step One: Create Your Folders)
With that, we’re ready to create the directories that we’ll use for this. Like I said above, we’re going to create a folder in the Downloads directory called “Bound.” So go ahead and open the Chrome OS Files app, and navigate to the Downloads directory.
這樣,我們就可以創建用于此目的的目錄了。 就像我上面說的,我們將在Downloads目錄中創建一個名為“ Bound”的文件夾。 因此,繼續打開Chrome OS文件應用,然后導航至下載目錄。
From there, right click and choose “New Folder.”
從那里,右鍵單擊并選擇“新建文件夾”。

Name this folder “Bound.”
將此文件夾命名為“ Bound”。

It’s worth noting that can name this whatever you like, but for the purposes of this tutorial and the commands you’ll use below, we’re using “Bound.”
值得注意的是,您可以隨意命名,但是出于本教程和下面將要使用的命令的目的,我們使用的是“綁定”。
If you have a specific set of files you want Android to be able to see on your Chromebook, go ahead and navigate to your external medium and create a new folder here, too. Name it accordingly—I’m using “Screenshots” for this example, so feel free to change it if it doesn’t make sense for your application. Just remember that you’ll have to change part of the commands below to reflect your folder name.
如果您有一組特定的文件,希望Android在Chromebook上可以看到,請繼續瀏覽到外部媒體并在此處創建一個新文件夾。 相應地命名-我在本例中使用“屏幕截圖”,因此,如果對您的應用程序沒有意義,請隨時進行更改。 請記住,您必須更改下面的部分命令以反映您的文件夾名稱。
第二步:打開一個根外殼并創建綁定 (Step Two: Open a Root Shell and Create the Bind)
First, you’re going to need to open a Crosh window by pressing Ctrl+Alt+T on your keyboard. A new, solid black window will open in your browser. Alternatively, you can install the Crosh Window app from the Chrome App Store (which also requires the Secure Shell app to be installed), but that’s not necessary if it’s something you don’t think you’ll use often.
首先,您需要通過按鍵盤上的Ctrl + Alt + T來打開Crosh窗口。 新的純黑色窗口將在您的瀏覽器中打開。 另外,您可以從Chrome App Store安裝Crosh Window應用程序(這也需要安裝Secure Shell應用程序),但是如果您不經常使用它,則不需要這樣做。
In the Crosh window, type the following:
在Crosh窗口中,鍵入以下內容:
shell
Followed by:
其次是:
sudo su
It will ask for your password—this should be the same one you sign into your Chromebook with.
它將要求您輸入密碼,該密碼應與您用來登錄Chromebook的密碼相同。

At this point, you’re in a root shell, which is what we want. The following commands should give you read/write access to the external folder directly from Android apps. For the purposes of this tutorial, I’m going to break them down one at at time, but keep in mind that you can string them together if you’d like—just separate each command with &&
symbols.
至此,您已經在root shell中,這就是我們想要的。 以下命令應使您可以直接從Android應用程序對外部文件夾進行讀/寫訪問。 出于本教程的目的,我將一次將它們分解,但請記住,如果需要,可以將它們串在一起-只需用&&
符號分隔每個命令。
Note: The default title for an external drive in Chrome OS is “UNTITLED.” If your drive has been named something else, use that in place of “UNTITLED” in the following commands.
注意:Chrome操作系統中外部驅動器的默認標題為“ UNTITLED”。 如果您的驅動器已被命名為其他名稱,請在以下命令中使用該驅動器代替“ UNTITLED”。
With that out of the way, enter the following into the root shell window:
這樣,就可以在root shell窗口中輸入以下內容:
mount --bind /media/removable/UNTITLED/Screenshots /run/arc/sdcard/default/emulated/0/Download/Bound
mount --bind /media/removable/UNTITLED/Screenshots /run/arc/sdcard/read/emulated/0/Download/Bound
mount --bind /media/removable/UNTITLED/Screenshots /run/arc/sdcard/write/emulated/0/Download/Bound

Again, change the name of the external folder to whatever you chose if it’s different than mine.
同樣,如果外部文件夾的名稱與我的不同,則將其更改為您選擇的名稱。
第三步:獲利 (Step Three: Profit)
That’s pretty much all there is to it. Like I said earlier, this won’t affect the way Chrome OS sees your folders, only Android.
這幾乎就是它的全部。 就像我之前說的,這不會影響Chrome操作系統查看文件夾的方式,僅影響Android。
Of course, it’s not a perfect system. Some Android apps may be able to see the contents of the bound folder, but not interact with them. For example, I use Skitch for annotating screenshots, and while it can see everything in the bound folder, it’s unable to open any of the files. This is probably in large part to do with the fact that Skitch is no longer in active development so it’s quite outdated, but it’s still a good example of how imperfect this system can be.
當然,這不是一個完美的系統。 某些Android應用程序可能能夠查看綁定文件夾的內容,但無法與其進行交互。 例如,我使用Skitch注釋屏幕截圖,盡管它可以看到綁定文件夾中的所有內容,但無法打開任何文件。 這可能在很大程度上與Skitch不再處于主動開發狀態,因此它已經過時了有關,但這仍然是該系統有多完美的一個很好的例子。
Also, this bind will not survive a reboot. So each time you reboot the computer, you’ll have to re-enter the above commands. I’ve also seen where some users have lost access to the bound folder after the system goes into sleep mode, but I haven’t personally had this issue. As with most workarounds like this one, your mileage may vary.
另外,此綁定將在重新啟動后無法幸免。 因此,每次重新啟動計算機時,都必須重新輸入上述命令。 我還看到系統進入睡眠模式后,某些用戶失去了對綁定文件夾的訪問權限,但是我個人沒有遇到這個問題。 與大多數這種解決方法一樣,您的工作量可能會有所不同。

Of course, Google is actively working on enabling SD card contents to Android apps, so eventually we should get proper support. But until that point, this is the next best thing.
當然,谷歌正在積極致力于為Android應用啟用SD卡內容,因此最終我們應該獲得適當的支持。 但是直到那一點,這才是下一件好事。
翻譯自: https://www.howtogeek.com/316056/how-to-get-android-apps-to-see-external-storage-on-chromebooks/
chromebook刷機