@Override
    public String generateShellScriptString() {
        StringBuilder sb = new StringBuilder();
        sb.append("#!/bin/sh\n");
        sb.append("adb remount\n");
        sb.append("adb push " + emmaPath + " /system/framework\n");
        sb.append("cd " + testDir + "\n");
        /// install apk
        String testDirName = testDir;
        if (testDirName.endsWith("/")) {
            testDirName = testDirName.substring(0, testDirName.length() - 1);
        }
        int index = testDirName.lastIndexOf('/');
        testDirName = testDirName.substring(index + 1);
        sb.append("adb install -r bin/" + testDirName + ".apk\n");
        String projectDirName = projectDir;
        if (projectDirName.endsWith("/")) {
            projectDirName = projectDirName.substring(0, projectDirName.length() - 1);
        }
        int index2 = projectDirName.lastIndexOf('/');
        projectDirName = projectDirName.substring(index2 + 1);
        sb.append("adb install -r ../" + projectDirName + "/bin/" + projectDirName + ".apk\n");
        
        sb.append("java -cp " + emmaPath + " emma instr -m overwrite -ip " + projectDir 
                + "bin/\n");
        sb.append("adb shell am instrument -w -e coverage true ");
        if (testClassNameList != null && testClassNameList.size() != 0) {
            sb.append("-e class ");
            for (String className : testClassNameList) {
                sb.append(testPackageName + "." + className + ",");
            }
            sb.deleteCharAt(sb.length() - 1);
            sb.append(' ');
        }
        sb.append(testPackageName + "/" + testRunnerName + "\n");

        sb.append("adb pull /data/data/" + projectPackageName + "/files/coverage.ec .\n");
        sb.append("java -cp " + emmaPath + " emma report -r html -in coverage.ec,coverage.em -sp " + projectDir + "src/\n");
        
//        String dest = createFolder();
//        System.out.println(dest);
//        sb.append("cp coverage/index.html " + dest + "\n");
//        sb.append("cp -r coverage/_files " + dest + "\n");

        
        return sb.toString();
    }