XCTest UI Testing - How to lock the screen? - xctest

Related to XCTest UI Testing - How to close and open an app without relaunch? is there any way to lock the screen from a UI test? XCUIDevice.Button only has three cases, home, volume up and volume down.

XCUIDevice has a private method for this. Shh, it's kinda secret.
XCUIDevice.shared.perform(NSSelectorFromString("pressLockButton"))

Related

React Native - Execute code in background on specific battery percentage

I have a react native application where the user can choose any battery level from 15 to 100. When his battery reaches the chosen value, javascript code should be executed.
Is there a way to do this when the app is in the background? I am aware I can have long running tasks, which will be displayed as a notification to the user and I can have my code logic there.
Are there any alternatives that do not include long running tasks?
My solution for this problem to register a BroadcastReceiver in android, which will be executed every time when the battery percentage changes. It works in background and if the battery reaches a certain threshhold, a headless task can be executed which will run javascript code.

How to debug the changes made in application on titanium without relaunching the application?

After launching the application, i make some code changes. Is relaunching the application necessary each and every time i make a change to the code.
MRT is right As there is Fastdev server(For classic approach) in Titanium which automatically push the changes to your app if there are changes except in app.js ,Also If you are using the Alloy Approach than for speedy development you can use Ti Shadow.
you can find it Here.
Use TIShadow!
It supports rapid deployment and testing of traditional titanium projects and alloy projects
Yes, you need to Relaunch again when you any change make in your code.
But, Some time this is working without Relaunch. But not in Home page. This is working when you are using on Sub view and use URL Property in CreateWindow Object.
But, best way to Relaunch you App always.
May this Information is helpful for you.
Thanks,

Long-running task performed in foreground is suspended when app enters background

When a user first opens my app, I need to download and install some content from a server before they can begin using the app. The problem is that this takes around 5 minutes on wifi, during which time the app goes into the background and the download is suspended.
Is there any way to either:
prevent an iOS app from entering the background whilst I perform my download
or continue peforming the task in the background (i.e. perform the task irrespective of whether the app is in the foreground or background)
Thanks
It really doesn't matter, if the user presses the home button it will go to background. Although you can do two things to mitigate the problem:
Use beginBackgroundTaskWithExpirationHandler, to give you a bit more time to download. Which you can read here.
Don't allow the device to become iddle, with [UIApplication sharedApplication].idleTimerDisabled = YES;. You can read more about that here.
Either way, the best thing you can do is to tell the user, that is an important download and he shouldn't quit the application.
Can't you include some or all of the content in your app bundle instead, and just download changes on first run?
I can't imagine this is a good first user experience, and it may not pass App Store review like this.
The only third party apps that are allowed to download in the background are newsstand apps loading issue content, and Apple are pretty strict about what they allow as newsstand apps.
You can't do what you want, in this situation. One way, and I think the best and only, is to resume your download when you app becomes active (returns to foreground state). Also, don't forget to register for connectivity notifications (Reachability class can be used for this purpose from this Apple sample app http://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html). Good Luck!

Rally AppSDK: Is there a way to facilitate "Inter-Panel" communication between Apps in the new layout schema

So I'm just getting used to and getting my arms around the new "panel-based" App scheme released with the 5/5/2012 version of Rally. At first it was a bit frustrating to lose the window real estate when I've been accustomed to full-page iFrames.
I am curious however - from a desire to optimize the way I use real estate onscreen for an App page - I would like to setup and utilize a multi-panel App whose components can communicate. For instance, I'd like to have one App panel display some control widgets and perhaps an AppSDK table, and a second App panel display a chart or grid that responds to events/controls in the first panel.
I've been scanning the AppSDK docs for hints as to how this might be accomplished, but I'm coming up short. Is there a way to wire up event listeners in one App panel that respond to widget controls in another?
We have not decided the best way to have the Apps communicate yet. That is something we are still spiking out internally to find the best way to do it.
Each custom App is in an IFrame so figuring out how to make them communicate can be a bit tricky. Once we figure out a good way to do it we will be sure to let you know.
Has this topic, "app Communication", been addressed yet? I would to have one Custom Grid show User Stories. When a user story is selected another grid show the related tasks.

Two native AIR windows from a single AIR app?

I'm building in FlashDevlop as pure AS3.
I'm looking at building a kiosk that uses two screens. Its used to administer tests. So one screen has the test, second the controls for admin the test. I have played with wide app but its not very elegant and I really would like both screens to run full screen on each screen. Is it possible to have one air app spawn two native air windows? A secondary question is it possible to detect multiple screens and target a screen to full screen to? Even something as simple as checking the window size to detect would work, im just not sure I can move and if the low level api will fullscreen on that screen. I could not find any examples of this in the docs.
What docs did you look into? I found it right away.
You'll need the Screen class if you want information on the screens that are connected to the PC. And here's some documentation on using it.
To create new windows, just instantiate a new NativeWindow class and call activate() on it when you're done configuring.
There's a lot of other useful stuff for you in the flash.display package. All the AIR stuff is marked with a little AIR icon. I have to admit that it would have been easier to find if they had put these classes in a separate AIR package.