如何在Linux系統上從Google Play商店下載APK檔案
您知道如何在Linux系統上從Google Play商店下載APK(Android軟體包工具包)檔案嗎?最簡單的方法之一是在Android手機上安裝APK,以便從Google Play商店將APK檔案下載到硬碟,然後手動將其安裝到Android裝置上。
在Linux系統上下載APK檔案的方法有很多種。其中最常用的一種方法是使用一個名為GooglePlayDownloader的開源Linux軟體。它基於Python的GUI。它允許您搜尋和下載來自Google Play商店的APK檔案。本文介紹瞭如何安裝GooglePlayDownloader以及如何使用它下載APK檔案。
Python依賴項
GooglePlayDownloader需要支援SNI(伺服器名稱指示)的Python來進行SSL/TLS通訊。此功能在Python 2.7.9或更高版本中提供。因此,在安裝GooglePlayDownloader之前,請安裝Python包。
方法一:自動安裝依賴項
步驟1 – 安裝GooglePlayDownloader的所有依賴項
在安裝GooglePlayDownloader之前,請下載python-ndg-httpsclient deb包,以便在較舊的Ubuntu發行版上安裝任何缺少的依賴項。要安裝python deb包,請使用以下命令:
$ wget http://mirrors.kernel.org/ubuntu/pool/main/n/ndg-httpsclient/python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb
輸出應如下所示:
tp@linux:~$ wget http://mirrors.kernel.org/ubuntu/pool/main/n/ndg-httpsclient/python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb --2016-02-11 15:07:01-- http://mirrors.kernel.org/ubuntu/pool/main/n/ndg-httpsclient/python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb Resolving mirrors.kernel.org (mirrors.kernel.org)... 198.145.20.143, 149.20.37.36, 2620:3:c000:a:0:1994:3:14, ... Connecting to mirrors.kernel.org (mirrors.kernel.org)|198.145.20.143|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 20814 (20K) [application/octet-stream] Saving to: ‘python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb’ 100%[======================================>] 20,814 73.2KB/s in 0.3s 2016-02-11 15:07:02 (73.2 KB/s) - ‘python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb’ saved [20814/20814]
步驟2 – 要安裝GooglePlayDownloader,請使用以下命令:
$ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb
輸出應如下所示:
$ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb --2016-02-11 15:08:54-- http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb Resolving codingteam.net (codingteam.net)... 212.83.148.207 Connecting to codingteam.net (codingteam.net)|212.83.148.207|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://codingteam.net/project/googleplaydownloader/upload/releases/googleplaydownloader_1.7-1_all.deb [following] --2016-02-11 15:08:54-- http://codingteam.net/project/googleplaydownloader/upload/releases/googleplaydownloader_1.7-1_all.deb Reusing existing connection to codingteam.net:80. HTTP request sent, awaiting response... 200 OK Length: 148458 (145K) [application/x-debian-package] Saving to: ‘googleplaydownloader_1.7-1_all.deb’ 100%[======================================>] 1,48,458 197KB/s in 0.7s 2016-02-11 15:08:55 (197 KB/s) - ‘googleplaydownloader_1.7-1_all.deb’ saved [148458/148458]
方法二:手動安裝依賴項
步驟1 – 安裝gdebi包
使用gdebi命令,它將自動處理所有其他命令。要安裝gdebi包,請使用以下命令:
$ sudo apt-get install gdebi-core
輸出應如下所示:
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: gdebi-core 0 upgraded, 1 newly installed, 0 to remove and 275 not upgraded. Need to get 9,772 B of archives. After this operation, 135 kB of additional disk space will be used. Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main gdebi-core all 0.9.5.3ubuntu2 [9,772 B] Fetched 9,772 B in 5s (1,757 B/s) Selecting previously unselected package gdebi-core. .....
步驟2 – 安裝python-ndg-httpsclient
要安裝python-ndg-httpsclient,請使用以下命令:
$ sudo gdebi python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb
輸出應如下所示:
Reading package lists... Done Building dependency tree Reading state information... Done Building data structures... Done Building data structures... Done enhanced HTTPS support for httplib and urllib2 using PyOpenSSL ndg-httpsclient is a HTTPS client implementation for httplib and urllib2 based on PyOpenSSL. PyOpenSSL provides a more fully featured SSL implementation over the default provided with Python and importantly enables full verification of the SSL peer. Do you want to install the software package? [y/N]:y Selecting previously unselected package python-ndg-httpsclient. (Reading database ... 204828 files and directories currently installed.) Preparing to unpack python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb ... Unpacking python-ndg-httpsclient (0.3.2-1ubuntu4) ... Setting up python-ndg-httpsclient (0.3.2-1ubuntu4) ... ....
步驟3 – 安裝GooglePlayDownloader
要安裝GooglePlayDownloader,請使用以下命令:
$ sudo gdebi googleplaydownloader_1.7-1_all.deb
輸出應如下所示:
Reading package lists... Done Building dependency tree Reading state information... Done Building data structures... Done Building data structures... Done Requires the installation of the following packages: libjs-jquery libjs-sphinxdoc libjs-underscore libwxbase2.8-0 libwxgtk-media2.8-0 libwxgtk2.8-0 python-configparser python-protobuf python-pyasn1 python-wxgtk2.8 python-wxversion Google Play Downloader Download Android application APK from Google Play Store without any personal Google account. Do you want to install the software package? [y/N]:y Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty/universe libwxbase2.8-0 amd64 2.8.12.1+dfsg-2ubuntu2 [460 kB] Get:2 http://in.archive.ubuntu.com/ubuntu/ trusty/universe libwxgtk2.8-0 amd64 2.8.12.1+dfsg-2ubuntu2 [2371 kB] Get:3 http://in.archive.ubuntu.com/ubuntu/ trusty/universe libwxgtk-media2.8-0 amd64 2.8.12.1+dfsg-2ubuntu2 [28.6 kB] Get:4 http://in.archive.ubuntu.com/ubuntu/ trusty/main libjs-jquery all 1.7.2+dfsg-2ubuntu1 [78.8 kB] Get:5 http://in.archive.ubuntu.com/ubuntu/ trusty/main libjs-underscore all 1.4.4-2ubuntu1 [45.6 kB] .....
開啟GooglePlayDownloader
要開啟GooglePlayDownloader,請使用以下命令:
$ googleplaydownloader
輸出應如下所示:
在搜尋欄中,鍵入您要下載的APK檔案的名稱。假設我搜索了tutorialspoint。輸出應如下所示:
單擊下載選定的APK(s)按鈕。輸出應如下所示:
最後,您將獲得硬碟上的選定APK檔案。
恭喜!現在,您知道“如何在Linux系統上從Google Play商店下載APK檔案”了。我們將在下一篇文章中學習更多關於這些命令型別的知識。繼續關注!