mirror of
https://github.com/revanced/jadb.git
synced 2025-06-13 05:37:44 +02:00
Now possible to launch apps by package name
This commit is contained in:
@ -77,7 +77,6 @@ public class JadbDevice {
|
|||||||
if (output != null) {
|
if (output != null) {
|
||||||
transport.readResponseTo(new AdbFilterOutputStream(output));
|
transport.readResponseTo(new AdbFilterOutputStream(output));
|
||||||
}
|
}
|
||||||
//return AdbFilterInputStream(transport.getInputStream());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<RemoteFile> list(String remotePath) throws IOException, JadbException {
|
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"));
|
String result = Stream.readAll(s, Charset.forName("UTF-8"));
|
||||||
verifyOperation("uninstall", name.toString(), result);
|
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());
|
pm = new PackageManager(jadb.getAnyDevice());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testLaunchActivity() throws Exception {
|
||||||
|
pm.launch(new Package("com.android.settings"));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testListPackages() throws Exception {
|
public void testListPackages() throws Exception {
|
||||||
List<Package> packages = pm.getPackages();
|
List<Package> packages = pm.getPackages();
|
||||||
|
Reference in New Issue
Block a user