Skip to content

Instantly share code, notes, and snippets.

@asciidisco
Created March 11, 2014 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asciidisco/9485421 to your computer and use it in GitHub Desktop.
Save asciidisco/9485421 to your computer and use it in GitHub Desktop.
Integrated Appium Server
// 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