I have 3 agents in a Jenkins cluster. All the three nodes have to run the same build in parallel. My build has to do the following two things:
1) It has to check the device status (available/locked).
2) Based on the device status: if the device is available, it has to lock the device and then schedule the device for some other actions.
Now, all the 3 nodes have to check the device status in parallel.
My question is:
If one node (agent1) locks a device (ex: dev1), how can I achieve that other nodes (agent2 or agent3) are getting the particular device (dev1) status as locked in Jenkins?
Related
I am currently trying to write a simple workout app with swift in Xcode.
With the App I want to read and write data to and from the health app. So far I started with an easy first step: A dummy app for reading and writing step counts.
At first everything seems to work, my app asked for data access, it is listed as a source in the health app and I can read and write step counts.
So far so good.
But sometimes the steps that were added by my app get ignored after some time.
Let's say I had 8000 Steps today and added 2000 via my app, at first I would see 10000 steps in the health app and in all other apps that read the steps count. But then after some time the total steps count in the health app would drop back to 8000 (and all reading apps would read 8000 again). But then when I look into the health app and go into the "all data" section for the steps count, I could still find the 2000 steps from my app in the list. They just seem to be ignored when calculating the total steps per day.
Does apple only allow steps from "validated" sources or is there another reason why my steps are ignored after some time?
If your app's step samples overlap with samples from other sources (like the iPhone or Apple Watch) then HealthKit may be preferring the overlapping samples. By default, HealthKit prefers samples from Apple Watch and iPhone. You can control which sources of samples are preferred, though, by going to the Health Data tab, and navigating to Activity > Steps > Data Sources & Access and then tapping the Edit button in the top right. You may then re-order the Data Sources section of the table.
Developing a daemon for jailbroken iDevices.
It's supposed to run when the iPhone is locked. However, the process seems to be put on hold after a little under a minute when the iPhone is locked (as seen by considering the "Total Process Running Time" given by CocoaTop). How can I prevent this, and make the daemon run all the time?
I'm sure this is possible, since when the phone is charging (plugged in) the daemon is not paused, and I see it working.
Wrapped the main method of the daemon in what's described here under Listing 2
I would like the Internal Testing and External Testing users on TestFlight to goto different API servers when they first run the app. I'm wondering if it's possible for the app to detect if it was installed as "Internal Testing" or "External Testing" app from TestFlight.
If this is not possible my next option was to build a separate app to send to Testflight that would use a different API server on startup. But this is more complicated.
The reason behind doing this is I only want external testers to see real data from the server. And not the bogus test data we have been submitting while developing the app.
As far as I know it is not possible to detect internal vs external testers running your application.
But you don't have to build two different applications. I have similar requirements than you: I have a special menu in the application settings where internal testers may tweak several aspects of the application, like for example the server they are connecting to, so they can test the application without messing with production data, or buying content in a controlled environment. I don't want those settings to be available to external testers, so I do the following:
I create two different build configurations, one for internal testers (e.g. ReleaseInternal), and other for the rest (Release)
I define a preprocessor macro / Swift flag in the internal tester build configuration (e.g. INTERNAL_TESTING)
I use the preprocessor macro / Swift flag to activate / deactivate certain sections of code or functionalities
I create two different schemas, each one using the corresponding build configuration, so you just have to switch the schema to build the appropriate version of the application
And finally, I automate the release of the application using fastlane, with a flag indicating whether I want to release the application to internal or external testers, so I don't make a mistake and release the wrong version to the wrong people
It is not possible to detect whether an app was installed as "Internal Testing" or "External Testing".
Another solution is to make a build that points to real data by default, but has a hidden switch you can teach internal users to use to switch to test data.
You can use NSUserDefaults to save the switch setting so internal users don't have to switch it every time they install a new build or re-launch the app.
If you're worried about real users finding your secret switch, you'll have to make a separate app as you say.
I'm trying to start a device using Genymotion GMTool from Jenkins by executing a batch command: "gmtool admin start $devicename" and the device does start
The problem is that as soon as the build ends, the device disappears from the screen copletely though is still visible in ADB.
Also, if i execute the same gmtool command from the windows cli the device stays on the screen.
Anyone knows what may cause this issue?
It's maybe because Jenkins process will kill all its childs and also the Genymotion device window running after the slave's job finished. But the problem here is that your Genymotion device is composed by a window (called "player") displaying the device and a headless virtual box process running the Android OS (including the ADB deamon).
If the device player is hardly killed, the vbox process will not be powered off at the same time. That's the reason why you still see the device connected to adb.
You can check this idea is true by checking on your running processes if you have a vbox headless process remaining after the window disappeared.
The solution could be:
to use another way to launch your devices (with a cron task for example).
to check if it is possible to set something on Jenkins to avoid this problem
to start a new device for each test run
Is it possible to set (Linux) cron like jobs in iOS apps (any version including iOS 8) that run at set times regardless of whether the app is open or in background mode?
For example, I'd like to run a network GET operation from an iPhone at 11:00 and 23:00. If the job doesn't run because the phone is powered down, that's ok.
There is no way to access the underlying cron on an non jailbroken device.
The closest would be UILocalNotification - effectively an alert with a specific fire date, or Background Fetch in iOS 7.
Background fetch lets your device wake on a requested interval to do some network activity. However you're still at the mercy of the system.
http://www.appcoda.com/ios7-background-fetch-programming/