Is it possible to simulate (or set) the following options on real devices?
1) Wifi on/of
2) SIM card
3) Battery on/off
4) Airplane mode on/off
5) Wifi/Local network change
6) Screen orientation change
"Simulation" on real devices
Re: "Simulation" on real devices
Hi,
you could try to use android OS automation which helps automating system apps on an android device. regards, qwertzu
you could try to use android OS automation which helps automating system apps on an android device. regards, qwertzu
You do not have the required permissions to view the files attached to this post.
Re: "Simulation" on real devices
Thanks. But what if I want to test iOS?
Re: "Simulation" on real devices
Hi,
iOS does not allow automate system apps. It's iOS security thing. There is nothing Ranorex can do about this. In fact, some of the mentioned apps may not be possible to automate even on Android.
iOS does not allow automate system apps. It's iOS security thing. There is nothing Ranorex can do about this. In fact, some of the mentioned apps may not be possible to automate even on Android.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: "Simulation" on real devices
I think some of the mentioned apps may not be possible to automate even on Android.
Re: "Simulation" on real devices
On Android device (Android OS automation true)
How I can change e.g. Airplane mode ?
It must be some user code...?
How I can change e.g. Airplane mode ?
It must be some user code...?
Re: "Simulation" on real devices
On Android device (Android OS automation true)
How I can change e.g. Airplane mode ?
It must be some user code...?
How I can change e.g. Airplane mode ?
It must be some user code...?
Re: "Simulation" on real devices
Hi,
You will most probably have to use ADB command for this. You can learn how to send ADB commands in Ranorex for example here:
send-adb-commands-via-ranorex-t10596.html#p42515
For an example of code for switching airplane mode, check this page:
https://stackoverflow.com/questions/105 ... b/23413344
Basically, you just need to extract the adb arguments from the above link and apply them in Ranorex code from the first link.
You will most probably have to use ADB command for this. You can learn how to send ADB commands in Ranorex for example here:
send-adb-commands-via-ranorex-t10596.html#p42515
For an example of code for switching airplane mode, check this page:
https://stackoverflow.com/questions/105 ... b/23413344
Basically, you just need to extract the adb arguments from the above link and apply them in Ranorex code from the first link.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: "Simulation" on real devices
Hi odklizec,
thank you for your answer.
I managed to set the airplane mode UI status on/off, but could not switch the mode really on/off
C:\Program Files (x86)\Ranorex\Studio\Bin\RxEnv\Android\Tools>adb shell am broadcast -a android.intent.action.AIRPLANE_MODE
Broadcasting: Intent { act=android.intent.action.AIRPLANE_MODE flg=0x400000 }
Security exception: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=27709, uid=2000
java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=27709, uid=2000
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:21899)
at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:22588)
at com.android.server.am.ActivityManagerShellCommand.runSendBroadcast(ActivityManagerShellCommand.java:683)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:174)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:16532)
at android.os.Binder.shellCommand(Binder.java:634)
at android.os.Binder.onTransact(Binder.java:532)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3530)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3426)
at android.os.Binder.execTransact(Binder.java:731)
Seems that I need to modify "AndroidManifest.xml" file and add there permission:
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Is that right?
And where can I found this AndroidManifest.xml file? I did remove the folder "decomp" under..\Android\temp. Should it be auto created when building a project?
thank you for your answer.
I managed to set the airplane mode UI status on/off, but could not switch the mode really on/off
C:\Program Files (x86)\Ranorex\Studio\Bin\RxEnv\Android\Tools>adb shell am broadcast -a android.intent.action.AIRPLANE_MODE
Broadcasting: Intent { act=android.intent.action.AIRPLANE_MODE flg=0x400000 }
Security exception: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=27709, uid=2000
java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=27709, uid=2000
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:21899)
at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:22588)
at com.android.server.am.ActivityManagerShellCommand.runSendBroadcast(ActivityManagerShellCommand.java:683)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:174)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:16532)
at android.os.Binder.shellCommand(Binder.java:634)
at android.os.Binder.onTransact(Binder.java:532)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3530)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3426)
at android.os.Binder.execTransact(Binder.java:731)
Seems that I need to modify "AndroidManifest.xml" file and add there permission:
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Is that right?
And where can I found this AndroidManifest.xml file? I did remove the folder "decomp" under..\Android\temp. Should it be auto created when building a project?
Re: "Simulation" on real devices
Hi,
I believe the AndroidManifest.xml is created during APK instrumentation, not during building the test project?
I believe the AndroidManifest.xml is created during APK instrumentation, not during building the test project?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: "Simulation" on real devices
Hi,
And now when I cannot instrument/use APK (made with crosswalk tech), is there any way I can get the AndroidManifest.xml what I could modify?
And now when I cannot instrument/use APK (made with crosswalk tech), is there any way I can get the AndroidManifest.xml what I could modify?
Re: "Simulation" on real devices
I think "Install RxBrowser" did the job and got the AndroidManifest.xml
When I added the <uses-permission android:name="android.permission.WRITE_SETTINGS" />, I still got this error:
C:\Program Files (x86)\Ranorex\Studio\Bin\RxEnv\Android\Tools>adb shell am broadcast -a android.intent.action.AIRPLANE_MODE
Broadcasting: Intent { act=android.intent.action.AIRPLANE_MODE flg=0x400000 }
Security exception: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=29648, uid=2000
java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=29648, uid=2000
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:21899)
at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:22588)
at com.android.server.am.ActivityManagerShellCommand.runSendBroadcast(ActivityManagerShellCommand.java:683)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:174)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:16532)
at android.os.Binder.shellCommand(Binder.java:634)
at android.os.Binder.onTransact(Binder.java:532)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3530)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3426)
at android.os.Binder.execTransact(Binder.java:731)
What I browsed (and understood : ) ), seems that it is no longer possible to set airplane mode or mobile data mode on/off?
Wlan can be easily set by:
adb shell "svc wifi enable"
adb shell "svc wifi disable"
When I added the <uses-permission android:name="android.permission.WRITE_SETTINGS" />, I still got this error:
C:\Program Files (x86)\Ranorex\Studio\Bin\RxEnv\Android\Tools>adb shell am broadcast -a android.intent.action.AIRPLANE_MODE
Broadcasting: Intent { act=android.intent.action.AIRPLANE_MODE flg=0x400000 }
Security exception: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=29648, uid=2000
java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=29648, uid=2000
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:21899)
at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:22588)
at com.android.server.am.ActivityManagerShellCommand.runSendBroadcast(ActivityManagerShellCommand.java:683)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:174)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:16532)
at android.os.Binder.shellCommand(Binder.java:634)
at android.os.Binder.onTransact(Binder.java:532)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3530)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3426)
at android.os.Binder.execTransact(Binder.java:731)
What I browsed (and understood : ) ), seems that it is no longer possible to set airplane mode or mobile data mode on/off?
Wlan can be easily set by:
adb shell "svc wifi enable"
adb shell "svc wifi disable"
- RobinHood42
- Posts: 324
- Joined: Fri Jan 09, 2015 3:24 pm
Re: "Simulation" on real devices
That seems to be true. According to this post, it is not possible.
https://stackoverflow.com/questions/438 ... -android-7
Cheers,
Robin
https://stackoverflow.com/questions/438 ... -android-7
Cheers,
Robin