Search Results

Search found 2 results on 1 pages for 'maxgabriel'.

Page 1/1 | 1 

  • Wake a Mac display from sleep via SSH

    - by MaxGabriel
    I'm using Jenkins as a CI server, where I'm SSHing into an iMac running OS X Mountain Lion (10.8.4) to run some UIAutomation integrations tests on an iOS app. The iMac actually sits 10 ft from me (but across a table) so I'm able to see the screen. However, the tests don't wake up the display, so I often can't see them. Is there a way to wake up the display from the terminal once Jenkins has SSHed in? So far I have tried using Applescript to press an arrow key, and using the Wake Assist application. I also tried setting the wake schedule to be the current date. Finally, I tried using the caffeinate command: caffeinate -t 300 &. The computer's "Wake for Wi-Fi access" checkbox is enabled. So far my best workaround is to just set the iMac to stay awake for atleast 3 hours. However, it'd be nice to keep normal sleep behavior, as I hypothesize that the screen waking from sleep would alert me visually that the integration tests are running. It's also significantly cooler :)

    Read the article

  • How to tell if leaving iOS app entered foreground from fast-app switching or manually?

    - by JPK
    Is there a way to tell if an iOS app enters the foreground from fast-app switching or manually? I need to know by the time applicationWillEnterForeground is called, so some specific code can be executed (or not executed) depending on the condition in which the app entered the foreground. EDIT: It turned out that this was more of a design issue for me. I moved my code to applicationDidBecomeActive. I also added a BOOL property to the appDelegate called fastAppSwitching (probably the wrong name for it). I set this to YES in application:handleOpenURL and application:openURL:sourceApplication:annotation. Then I added the following code to application:didFinishLaunchingWithOptions: if (launchOptions) { self.fastAppSwitching = YES; } else { self.fastAppSwitching = NO; } In applicationDidBecomeActive, I used the following code: if (fastAppSwitching == YES) { self.fastAppSwitching = NO; //stop, don't go any further } else { ... } EDIT2: MaxGabriel makes a good point below: "Just a warning to others taking the solution described here, applicationDidBecomeActive: is called when the user e.g. ignores a phone call or text message, unlike applicationWillEnterForeground". This is actually also true for in-app purchases and Facebook in-app authorization (new in iOS 6). So, with some further testing, this is the current solution: Add a new Bool called passedThroughWillEnterForeground. In applicationWillResignActive: self.passedThroughWillEnterForeground = NO; In applicationDidEnterBackground: self.passedThroughWillEnterForeground = NO; In applicationWillEnterForeground: self.passedThroughWillEnterForeground = YES; In applicationDidBecomeActive: if (passedThroughWillEnterForeground) { //we are NOT returning from 6.0 (in-app) authorization dialog or in-app purchase dialog, etc //do nothing with this BOOL - just reset it self.passedThroughWillEnterForeground = NO; } else { //we ARE returning from 6.0 (in-app) authorization dialog or in-app purchase dialog - IE //This is the same as fast-app switching in our book, so let's keep it simple and use this to set that self.fastAppSwitching = YES; } if (fastAppSwitching == YES) { self.fastAppSwitching = NO; } else { ... } EDIT3: I think we also need a bool to tell if app was launched from terminated.

    Read the article

1