mirror of
https://github.com/revanced/jadb.git
synced 2025-02-11 09:36:48 +01:00
Now possible to launch apps by package name
This commit is contained in:
parent
a1e55f06d8
commit
07f74cb20a
@ -77,7 +77,6 @@ public class JadbDevice {
|
||||
if (output != null) {
|
||||
transport.readResponseTo(new AdbFilterOutputStream(output));
|
||||
}
|
||||
//return AdbFilterInputStream(transport.getInputStream());
|
||||
}
|
||||
|
||||
public List<RemoteFile> list(String remotePath) throws IOException, JadbException {
|
||||
|
@ -60,4 +60,8 @@ public class PackageManager {
|
||||
String result = Stream.readAll(s, Charset.forName("UTF-8"));
|
||||
verifyOperation("uninstall", name.toString(), result);
|
||||
}
|
||||
|
||||
public void launch(Package name) throws IOException, JadbException {
|
||||
InputStream s = device.executeShell("monkey", "-p", name.toString(), "-c", "android.intent.category.LAUNCHER", "1");
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,11 @@ public class PackageMangerTests {
|
||||
pm = new PackageManager(jadb.getAnyDevice());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLaunchActivity() throws Exception {
|
||||
pm.launch(new Package("com.android.settings"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testListPackages() throws Exception {
|
||||
List<Package> packages = pm.getPackages();
|
||||
|
Loading…
x
Reference in New Issue
Block a user