网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

手机使用linux命令 手机怎么用linux

如何在APK程序里执行linux命令

Android的底层是Linux内核,因此在shell环境下可以运行Linux命令,尤其是经过root处理的android系统,基本上可以通过调用Linux命令完全控制手机,下面的RootCmd.java代码可以实现运行Linux外部命令。

创新互联公司成立于2013年,是专业互联网技术服务公司,拥有项目网站设计制作、网站设计网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元浮梁做网站,已为上家服务,为浮梁各地企业和个人服务,联系电话:028-86922220

package my.android.code;

import android.os.Environment;

import dalvik.annotation.Signature;

import java.io.BufferedReader;

import java.io.DataInputStream;

import java.io.DataOutputStream;

import java.io.File;

import java.io.FileReader;

import java.io.InputStream;

import java.io.OutputStream;

import java.util.Vector;

public final class RootCmd

{

//执行linux命令并且输出结果

protected static Vector execRootCmd(String paramString)

{

Vector localVector = new Vector();

try

{

Process localProcess = Runtime.getRuntime().exec("su ");//经过Root处理的android系统即有su命令

OutputStream localOutputStream = localProcess.getOutputStream();

DataOutputStream localDataOutputStream = new DataOutputStream(localOutputStream);

InputStream localInputStream = localProcess.getInputStream();

DataInputStream localDataInputStream = new DataInputStream(localInputStream);

String str1 = String.valueOf(paramString);

String str2 = str1 + "\n";

localDataOutputStream.writeBytes(str2);

localDataOutputStream.flush();

String str3 = localDataInputStream.readLine();

localVector.add(str3);

localDataOutputStream.writeBytes("exit\n");

localDataOutputStream.flush();

localProcess.waitFor();

return localVector;

}

catch (Exception localException)

{

localException.printStackTrace();

}

}

//执行linux命令但不关注结果输出

protected static int execRootCmdSilent(String paramString)

{

try

{

Process localProcess = Runtime.getRuntime().exec("su");

Object localObject = localProcess.getOutputStream();

DataOutputStream localDataOutputStream = new DataOutputStream((OutputStream)localObject);

String str = String.valueOf(paramString);

localObject = str + "\n";

localDataOutputStream.writeBytes((String)localObject);

localDataOutputStream.flush();

localDataOutputStream.writeBytes("exit\n");

localDataOutputStream.flush();

localProcess.waitFor();

localObject = localProcess.exitValue();

return localObject;

}

catch (Exception localException)

{

localException.printStackTrace();

}

}

//判断机器Android是否已经root,即是否获取root权限

protected static boolean haveRoot()

{

int i = execRootCmdSilent("echo test"); //通过执行测试命令来检测

if (i != -1)  return true;

retrun false;

}

}

linuxedr命令

linuxedr命令,目前应用在手机上的操作系统主要有Symbian 、Windows CE 、MacOSX、PalmOS和Linux几种。

Symbian系统

Symbian OS(中文译音“塞班系统”)由诺基亚、索尼爱立信、摩托罗拉、西门子、等几家大型移动通讯设备商共同出资组建的一个合资公司,专门研发手机操作系统。它是一个实时性、多任务的纯32位操作系统,具有功耗低、内存占用少等特点,非常适合手机等移动设备使用,经过不断完善,可以支持GPRS、蓝牙、SyncML、以及3G技术。最重要的是它是一个标准化的开放式平台,任何人都可以为支持Symbian的设备开发软件。Symbian将移动设备的通用技术,也就是操作系统的内核,与图形用户界面技术分开,能很好的适应不同方式输入的平台,也可以使厂商可以为自己的产品制作更加友好的操作界面,符合个性化的潮流,这也是用户能见到不同样子的symbian系统的主要原因。现在为这个平台开发的各种软件已经开始在互联网上盛行。用户可以通过安装这些软件,扩展手机的功能。 同时为了配合流行的操作习惯,厂家推出了基于 Symbian OS的三种平台:S60配合单手操作,S80配合双手操作,UIQ配合使用触笔操作。 在Symbian发展阶段,出现了三个分支:分别是Crystal、Pearl和Quarz。前两个主要针对通讯器市场,也是出现在手机上最多的,是今后智能手机操作系统的主力军。 第一款基于Symabian系统的手机是2000年上市的某款爱立信手机。而真正较为成熟的同时引起人们注意的则是2001年上市的诺基亚9210,它采用了Crystal分支的系统。 2002年推出的诺基亚7650与3650则是Symbian Pearl分系的机型,其中7650是第一款基于2.5G网的智能手机产品,他们都属于Symbian的V6.0版本。索尼爱立信推出的一款机型也使用了Symbian的Pearl分支,版本已经发展到V7.0,是专为3G网络而开发的。 2004年诺基亚紧发布S60第2版Feature Pack3采用Symbian OS v8.1操作系统。 2005年2月14日发布,诺基亚发布了S60 3rd Edition(第三版),它正是主要基于Symbian OS v9.1操作系统的。S60第三版提供了由Symbian Signed认证和一种更高效的二进制格式来加强行业领先的安全性。 2008年6月24日塞班公司被诺基亚全资收购,成为诺基亚旗下公司。如今以诺基亚,索尼爱立信为主的塞班操作系统的智能手机拥有着规模相当庞大的用户群体。 Symbian OS 智能手机代表机型列举: S60:诺基亚QD,N70,N73,N95,E71,N82,N96等。 S80:诺基亚6708等。 UIQ:索爱M608,W908,G908等。

安卓不是Linux系统么?请问如何在手机中执行linux命令,如ls、vi之类的?谢谢!

安卓可不是LINUX,是谷歌支持发展起来的独立操作系统。

虽然采用了Linux内核,但没有本地窗口,也不支持那些Linux的基础应用。

android 中linux 命令pm常见用法(安装卸载app)

27种用法格式 :

用法说明 :

1、 pm list packages : prints all packages, optionally only those whose package name contains the text in FILTER. Options:

例子:列出系统中所有packages

2、 pm list permission-groups : prints all known permission groups.

例子:

3、 pm list permissions : prints all known permissions, optionally only those in GROUP. Options:

例子:列出系统所有许可

4、 pm list instrumentation : use to list all test packages; optionally supply to list the test packages for a particular application. Options:

-f: list the .apk file for the test package.

5、 pm list features : prints all features of the system.

例子:列出所有手机特性

6、 pm list users : prints all users on the system.

例子:

7、 pm path : print the path to the .apk of the given PACKAGE.

例子:按包名查找apk文件所在路径

8、 pm dump : print system state associated with the given PACKAGE.

9、 pm install : installs a package to the system. Options:

例子:

10、 pm uninstall : removes a package from the system. Options:

-k: keep the data and cache directories around after package removal. 保留数据

例子:

11、 pm clear : deletes all data associated with a package..

例子:只删除数据

12、 pm enable, disable, disable-user, disable-until-used : these commands change the enabled state of a given package or component (written as "package/class").

13、 pm grant, revoke : these commands either grant or revoke permissions to applications. Only optional permissions the application has declared can be granted or revoked.

14、 pm get-install-location : returns the current install location.

15、 pm set-install-location : changes the default install location.

NOTE: this is only intended for debugging; using this can cause applications to break and other undersireable behavior.

16、 pm trim-caches : trim cache files to reach the given free space.

17、 pm create-user : create a new user with the given USER_NAME, printing the new user identifier of the user. 创建新用户

18、 pm remove-user : remove the user with the given USER_IDENTIFIER, deleting all data associated with that user 。 按用户ID删除用户


网页标题:手机使用linux命令 手机怎么用linux
标题来源:http://bjjierui.cn/article/dddiesh.html

其他资讯