songxiyuan / android-serialport-api

Automatically exported from code.google.com/p/android-serialport-api
0 stars 0 forks source link

java.io.IOException: Error running exec(). Command: [/system/bin/su] Working Directory: null Environment: null #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi 
I am going through Android serial port Api and facing some problem as below

 1) When i built and deploy this serial port application on Android 3.0, ndk 5 ,cygwin 5 and Window Xp enviroment then its work properly

 2) but when i tried to de built and deploy on Android 2.2 or lower version then i m getting error below 
    java.io.IOException: Error running exec(). Command: [/system/bin/su] Working Directory: null Environment: null

      I Cretaed AVD 2.2 from commnand line and nothing i changed in any other place and deploy then getting error above

    I set the permission also from cygwin to dev/ttyS2 but didnt work 
can you please tell me what i am doing wrong ?

          Thanks in Advance

Original issue reported on code.google.com by ashishli...@gmail.com on 12 May 2011 at 5:22

GoogleCodeExporter commented 8 years ago
From a quick look that appears as though the there is an error running the 
/system/bin/su on the device.

I have seen a similar problem on a Android 3.1 production device.

Is the Android 2.2 a physical device or an AVD?

Original comment by npda...@gmail.com on 10 Aug 2011 at 2:52

GoogleCodeExporter commented 8 years ago
"/system/bin/su" is only present on rooted Android versions, like Cyanogen. It 
is not present on the emulator.

Nevertheless, the "su" command only gets executed if the serial port does not 
have the proper access rights in the first place.

You have to type "adb shell chmod 777 /dev/tty<>" each time you restart the 
emulator
(of course replace /dev/tty<>" by your serial device)

Original comment by cedric.p...@gmail.com on 25 Oct 2011 at 10:05

GoogleCodeExporter commented 8 years ago
Hi,

Please check your AndroidManifest.xml for the minSdkVersion you configured.

while executed on Android3.0 may set default as 11, for Android2.2 it is 8.

VGR

Original comment by gnanam.r...@gmail.com on 16 Nov 2011 at 5:29

GoogleCodeExporter commented 8 years ago
Gnanam, why should I increase minSdkVersion? I do not need any of the features 
introduced by newer SDKs, and it would break the support for Android 1.5 to 2.3 
devices!

Original comment by cedric.p...@gmail.com on 16 Nov 2011 at 11:46