草庐IT

exec_gap

全部标签

java.io.ioexception.Runtime.getRuntime().exec()。 android中的环境和工作目录空错误

Filedir=newFile("/mnt/sdcard");Processprocess=Runtime.getRuntime().exec("ffmpeg-fimage2-iimg%4d.pngvideo.mp4",null,dir);当我在android中尝试此行时,我在android中遇到环境和工作目录空错误。但是当我在java中尝试该行时,它工作得很好。但是在android中,它有一些问题。 最佳答案 igetenvironmentandworkingdirectorynull它会返回null,因为没有像/mmt/sdca

java - 使用带有 JSch 的 "exec" channel 运行命令不返回任何输出

我正在尝试使用JSch从Android使用SSH在Linux服务器上执行命令。据我所知,我正在连接到服务器,但是当我尝试检索命令的结果时,我什么也没得到。连接到服务器:publicclassSSHCommand{publicstaticStringexecuteRemoteCommand(Stringusername,Stringpassword,Stringhostname,intport)throwsException{JSchjsch=newJSch();Sessionsession=jsch.getSession(username,hostname,port);session.

android - 错误 :(47) Error parsing XML: unbound prefix in android phone gap

我在androidstudio工作。我在这里做android手机间隙中的toast弹出消息,但我是获取ErrorparsingXML:unboundprefixinlineno47in(xmlns:android="http://www.w3.org/ns/widgets")下面是config.xml代码请给我建议。提前谢谢你。HelloCordovaAsampleApacheCordovaapplicationthatrespondstothedevicereadyevent.ApacheCordovaTeam 最佳答案 添加这一

java - 在 Ant exec 任务中检测超时

当你在Antexectask中设置了timeout属性,当task超时了进程,有没有办法检测超时?我在结果、输出或错误属性中没有看到任何有用的指示超时的信息。 最佳答案 当由于超时杀死子进程,父Ant进程记录消息Timeout:killedthesub-process.然而,由于重定向器仅捕获子进程的输出,中没有超时指示outputProperty或errorProperty.要设置指示子进程超时的属性,可以使用捕获Ant的日志输出。任务如下例所示。输出exec-timeout:[exec]Timeout:killedthesub-

Runtime.getRuntime().exec() 上的 Android 权限

我有一个在list上具有以下权限的应用程序。我的应用程序在AndroidJB4.1.2上运行。更新:我正在尝试在JB上运行该应用程序,但它不起作用。它适用于较早的API版本。问题是当我执行这样的命令时:Processproc=Runtime.getRuntime().exec("servicecallactivity42s16com.android.systemui");BufferedReaderbufferedReader=newBufferedReader(newInputStreamReader(proc.getInputStream()));Stringline;while(

android - 为什么从 Android NDK 中删除了 exec_elf.h?

查看AndroidNDKr12,我可以看到platforms/android-{APIlevel}/{arch}/usr/include/sys下的头文件存在差异。对于API级别19及以下,文件exec_elf.h存在,但之后似乎已被删除。添加或删除文件还有许多其他差异,但我对exec_elf.h感兴趣,因为它定义了一个特定的宏:#defineELF64_ST_INFO(b,t)(((b)这个宏在ICU源代码中使用,如果我使用API目标设置为19之后的任何工具链,我的ICU交叉编译构建失败。构建失败并出现以下错误:arm-linux-androideabi-clang...icu/so

android - 如何停止由 run.exec() 在 android 中启动的进程

如何停止“ping”?以下代码是我尝试的方式,但失败了。privateclasspingWifiimplementsRunnable{Processp=null;@Overridepublicvoidrun(){//TODOAuto-generatedmethodstub/**WifiInfoinfo=mWifiManager.getConnectionInfo();int*ip=info.getIpAddress();Stringips=Formatter.formatIpAddress(ip);*/System.out.println("pingWifirunnable");Str

java - 运行 exec() 时出错。命令 : Working Directory: null Environment: null - how to execute a binary in Android correctly on a non-rooted device?

我想在非root的android设备上运行可执行文件。在java中使用以下命令Runtime.getRuntime().exec("/bin/chmod744/data/data/com.example.myapp/myBin");Runtime.getRuntime().exec("/data/data/com.example.myapp/myBin");结果Errorrunningexec().Command:[/data/data/com.example.myapp/myBin]WorkingDirectory:nullEnvironment:null我发现了很多关于此的问题,但

android - java.io.IOException : Error running exec(). 命令 : [cd, sdcard/.yasmin] 工作目录:null 环境:null

我尝试访问我在sdcard中的文件夹并安装myapp.apk,我使用此代码:Runtime.getRuntime().exec("cdsdcard/.yasmin");Runtime.getRuntime().exec("adbinstalltefli.apk");但不幸的是我有这个错误:05-1111:09:57.925:WARN/System.err(1399):java.io.IOException:Errorrunningexec().Commands:[cd,sdcard/.yasmin]WorkingDirectory:nullEnvironment:null任何人请有想法

android - Phone Gap 摄像头方向

我使用PhoneGap版本0.9.3开发了一个应用...当我在我的应用程序中打开相机时,它总是以横向模式打开,并且在拍摄时,图像以横向格式返回...如何将相机模式更改为纵向模式navigator.camera.getPicture(onsuccess,fail,{quality:45,destinationType:Camera.DestinationType.DATA_URL,sourceType:src},img_id);functiononsuccess(imageData){localStorage.setItem("image_captured","Yes");$('#'+i