Created
March 11, 2014 13:18
-
-
Save asciidisco/9485421 to your computer and use it in GitHub Desktop.
Integrated Appium Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using appium 0.9.something it was paossible to do this | |
// appium server (this file doesn't exist anymore) | |
var appium = require('appium/server'); | |
// some args | |
var appiumArgs = { | |
app: null, | |
ipa: null, | |
quiet: true, | |
udid: null, | |
keepArtifacts: false, | |
noSessionOverride: false, | |
fullReset: false, | |
noReset: false, | |
launch: false, | |
log: false, | |
nativeInstrumentsLib: false, | |
safari: false, | |
forceIphone: false, | |
forceIpad: false, | |
orientation: null, | |
useKeystore: false, | |
address: '0.0.0.0', | |
nodeconfig: null, | |
port: 9020, | |
webhook: 'http://localhost:3048' | |
}; | |
// make appium server globally available | |
var ap = null; | |
var _afterRun = function (appiumServer) { | |
ap = appiumServer; | |
}; | |
// kill appium servers | |
var _killAppium = function () { | |
ap.webSocket.server.close(); | |
ap.rest.listen().close(); | |
}; | |
// start appium server | |
appium.run(appiumArgs, _afterRun); | |
setTimeout(function () { | |
_killAppium(); | |
// so some other weird shit to kill | |
// simulator processes | |
}, 20000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment