jeudi 29 décembre 2016

start test apk in another apk

Android version: 4.1 .

I want to test my apk without pc, so i write android apk to do it.

 Process proc = Runtime.getRuntime().exec(command);

    try {
        if (proc.waitFor() != 0) {
            System.err.println("exit value = " + proc.exitValue());
           // proc.waitFor();
        }
        BufferedReader in = new BufferedReader(new InputStreamReader(
                proc.getInputStream()));
        StringBuffer stringBuffer = new StringBuffer();
        String line = null;
        while ((line = in.readLine()) != null) {
            stringBuffer.append(line+"\n");
        }

       // proc.waitFor();
        System.out.println(stringBuffer.toString());
        Log.i("info",stringBuffer.toString());
        return  stringBuffer.toString();
    } catch (InterruptedException e) {
        System.err.println(e);
    }

and the command is

am instrument -w -e deleteCase no http://ift.tt/2iHryfo

but it's not worked.

Aucun commentaire:

Enregistrer un commentaire