[Title]Fix command to check device type
authorhyunsik.noh <hyunsik.noh@samsung.com>
Fri, 5 Apr 2013 08:13:49 +0000 (17:13 +0900)
committerhyunsik.noh <hyunsik.noh@samsung.com>
Mon, 8 Apr 2013 00:30:53 +0000 (09:30 +0900)
[Type]
[Module]common
[Priority]
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]

Change-Id: I4f8b50f3fc05dfed978da62e7ce878f9ed32c175

org.tizen.common.sdblib/src/org/tizen/sdblib/Device.java

index 618b22b..dcf44ca 100644 (file)
@@ -30,7 +30,8 @@ final class Device implements IDevice {
 
     final static String COMMAND_ARCHITECTURE_INFO = "uname -m";
     final static String EMULATOR = "emulator";
-    final static String COMMAND_DEVICE_TYPE = "[ -f /dev/samsung_sdb ] || echo " + EMULATOR;
+    final static String RESULT_EMULATOR = "0";
+    final static String COMMAND_DEVICE_TYPE = "ls -al /dev/samsung_sdb 2>/dev/null | wc -l ";
     public final static String DEFAULT_APP_INSTALL_PATH = "/opt/usr/apps";
     public final static String PKG_TOOL_INSTALL_PATH_COMMAND = "/usr/bin/pkgcmd -a";
     public final static String PKG_TOOL_INSTALL_PATH_COMMAND_RESULT = "Tizen Application Installation Path:";
@@ -313,7 +314,7 @@ final class Device implements IDevice {
         public void processNewLines(String[] lines) {
             for(String line : lines) {
                 if(line != null) {
-                    if(EMULATOR.equals(line.toLowerCase())) {
+                    if(RESULT_EMULATOR.equals(line)) {
                         mIsEmulator = true;
                         break;
                     }