如何在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文件”了。我们将在下一篇文章中学习更多关于这些命令类型的知识。继续关注!

更新于:2020年1月28日

4K+浏览量

启动您的职业生涯

通过完成课程获得认证

开始
广告