Skip to content

Commit

Permalink
Merge pull request #2 from reach2jeyan/getpath
Browse files Browse the repository at this point in the history
Added to open terminal directly
  • Loading branch information
emjeyforta authored Jul 8, 2019
2 parents 8d4f800 + 3d84436 commit 08b2d5a
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Stress Test your Android App(Under development)


OS Supported
1. Mac
2. Windows(BETA)
2. Windows(Unreleased)

Usage
1. Download the dmg file and install it on your mac machine
Expand Down
4 changes: 2 additions & 2 deletions app/first.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</span>

<div class="wrap-input1 validate-input" data-validate = "Name is required">
<input id="android_sdk_path" class="input1" type="text" name="name" placeholder="Enter adb path of your system">
<input id="android_sdk_path" class="input1" type="text" name="name" placeholder="Copy ANDROID_HOME path till /adb">

<span class="shadow-input1"></span>
</div>
Expand All @@ -56,7 +56,7 @@
</button>
<button id="btnadbinfo" class="contact1-form-btn">
<span>
Get Path
Open Terminal
<i class="fa fa-long-arrow-right" aria-hidden="true"></i>
</span>
</button>
Expand Down
14 changes: 11 additions & 3 deletions app/first.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ console.log('first js.js');
//var cmd = require('node-command-line'),Promise = require('bluebird');
var cmd=require('node-cmd');
const { exec } = require('child_process').exec;
const path = require('path');
const os = require('os');

const child_process = require('child_process');

if(localStorage.getItem("path")){
window.location="index.html";
Expand All @@ -18,15 +22,19 @@ function navigate(){
}

function determineOS() {
const {app} = require('electron');
if (process.platform === "win32") {
alert("We detected you are using windows. Please type 'adb' in your command prompt and copy the value from 'Installed at'")
}
else {
alert("we are still working on fetching this, please add your ANDROID_HOME path or WHICH ADB path with upto adb")

const { app } = require ('electron').remote;
const atPath = app.getPath ('desktop');
const { spawn } = require ('child_process');
let openTerminalAtPath = spawn ('open', [ '-a', 'Terminal', atPath ]);
openTerminalAtPath.on ('error', (err) => { console.log (err); });

}
}
function deletelocalstorage() {
window.localStorage.clear();
}

Binary file added assets/.DS_Store
Binary file not shown.
Binary file modified assets/androidmobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/.DS_Store
Binary file not shown.
Binary file removed assets/icons/png/OneDrive.png
Binary file not shown.
73 changes: 72 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ const electron =require('electron');
//for UI "app"
const app=electron.app;
const BrowerWindow=electron.BrowserWindow;

const path=require('path');
const url=require('url');
const {Menu} = require('electron')



let win; //reference to window

Expand Down Expand Up @@ -36,6 +38,75 @@ app.on('window-all-closed',()=>{
app.on('activate',()=>{
if(win==null){
createWindow()
createMenu
}
});

// Create the Application's main menu
function createMenu() {
const application = {
label: "Application",
submenu: [
{
label: "About Application",
selector: "orderFrontStandardAboutPanel:"
},
{
type: "separator"
},
{
label: "Quit",
accelerator: "Command+Q",
click: () => {
app.quit()
}
}
]
}

const edit = {
label: "Edit",
submenu: [
{
label: "Undo",
accelerator: "CmdOrCtrl+Z",
selector: "undo:"
},
{
label: "Redo",
accelerator: "Shift+CmdOrCtrl+Z",
selector: "redo:"
},
{
type: "separator"
},
{
label: "Cut",
accelerator: "CmdOrCtrl+X",
selector: "cut:"
},
{
label: "Copy",
accelerator: "CmdOrCtrl+C",
selector: "copy:"
},
{
label: "Paste",
accelerator: "CmdOrCtrl+V",
selector: "paste:"
},
{
label: "Select All",
accelerator: "CmdOrCtrl+A",
selector: "selectAll:"
}
]
}

const template = [
application,
edit
]

Menu.setApplicationMenu(Menu.buildFromTemplate(template))
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
"macbuild": "electron-installer-dmg --out=/Users/sequoiamac2/Desktop/StressTest/build"
},
"build": {
"appId": "com.electronAI.product",
"productName": "StressTest"
"appId": "com.appstresser.product",
"productName": "AppStresser"
},
"author": "Mrityunjeyan Sarvabhouman",
"license": "ISC",
"license": "MIT",
"devDependencies": {
"electron": "^1.8.2",
"electron-builder": "^20.41.0",
"electron-installer-dmg": "^2.0.0"
},
"dependencies": {
"electron-default-menu": "^1.0.1",
"fix-path": "^2.1.0",
"fs-jetpack": "^1.3.0",
"node-adb": "^0.1.6",
Expand Down

0 comments on commit 08b2d5a

Please sign in to comment.