相关疑难解决方法(0)

在模拟器中将意图发送到应用程序

是否有可能将自动意图发送到模拟器内的应用程序进行测试?

我有一个我所有意图的列表,我想自动测试它们,所以可以只在一个设备adb shell <myfancycommand> android.intent.action.PACKAGE_ADDED上启动android.intent.action.PACKAGE_ADDED操作吗?或者我是否必须编写一个脚本来自己调用所有的东西,所以例如为此意图在设备上安装一个虚拟apk?

testing android adb android-emulator

8
推荐指数
1
解决办法
5452
查看次数

Android Instrumentation测试脱机案例

对于我的仪器测试我正在使用Robotium.大多数情况下,除了离线情况,我能够测试一切.

只要我禁用数据(使用adb,模拟器中的F8快捷键等等),测试就会断开连接.它继续在设备/模拟器中,但没有报告结果.

所以,我有一个想法,只将应用程序放在离线模式而不是整个设备.问题是我不知道怎么样......

使用iptablesApi我需要root我的设备.我已经读过,Mobiwol应用程序使用某种VPN来限制应用程序的互联网访问,而无需生根设备.

问题Mobiwol应用程序 如何阻止每个应用程序的互联网连接?或者还有其他方法可以离线测试apks吗?

编辑12/30/2014

我忘了说我可以脱机运行测试,但是当设备处于脱机状态时我必须开始测试.目前,我将测试分为OFFLINE和ONLINE.运行ONLINEs后,我执行着名的adb kill-serveradb start-server.之后我执行OFFLINEs.

android android-testing

8
推荐指数
3
解决办法
3384
查看次数

使用 ADB 更改 android 壁纸?

我想知道是否可以使用我的笔记本电脑从 ADB 更改 android 壁纸。我不知道是否存在任何命令,或者我是否需要将图片复制到文件夹中或编辑文本文件。如果可以的话,我需要用亚行解决这个问题。

谢谢大家

android adb

5
推荐指数
2
解决办法
1万
查看次数

通过 AlarmManager 创建的警报在 25 天后未运行(= 2^31 - 1 = 2147483647 毫秒)

背景: 我有一个在 Android 7.1 上运行的 Android 应用程序。使用 AlarmManage 设置重复任务,以便每天在特定时间执行任务。代码如下:

AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
long startInMs = getComing9AM();
Intent intent = ...; //an intent to be run when alarm time is up.
PendingIntent ScheduledIntent = PendingIntent.getBroadcast(context, id, intent, 0);
am.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, startInMs, ScheduledIntent);


private long getComing9AM(){
    long now = System.currentTimeMillis();
    long today = getToday9AM();
    return (now < today? today:getTomorrow9AM());
}

private long getToday9AM(){
    Calendar calendar = Calendar.getInstance();
    calendar.setTimeInMillis(System.currentTimeMillis());
    calendar.set(Calendar.HOUR_OF_DAY, 9);
    calendar.set(Calendar.MINUTE, 0);
    calendar.set(Calendar.SECOND, 0);
    return calendar.getTimeInMillis();
}

private long getTomorrow9AM(){
    return …
Run Code Online (Sandbox Code Playgroud)

android alarmmanager android-7.1-nougat

5
推荐指数
1
解决办法
101
查看次数