- connect your device/emulator
- run the app from Android Studio (AS)
- use/test the app and uninstall it from the device while it is still connected to your computer
- try to run the app again from AS
Run app from AS again after uninstalling with ADB.
There's no bigger headache for me than to exercise hours for build tools, and non-trivial development pipelines at the inception of a project.
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.1/react.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.1/react-dom.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.8.1/axios.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
dependencies necessary for React to play with Electron, plus axios
Let's get some React to integrate!
Check out this awesome project at CodePen!ok, plugging it in, you should have something similar to the project in this repo!
'use strict';
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const url = 'http://127.0.0.1:1987';
let mainWindow, child;
function windowRouter(_route) {
return url + '/' + (_route || '');
}
function renderWindow() {
mainWindow = new BrowserWindow({width: 800, height: 600});
mainWindow.loadURL(windowRouter());
// default to inspector mode in Chromium
mainWindow.webContents.openDevTools();
mainWindow.on('closed', function() {
mainWindow = null;
});
}
function createWindow () {
renderWindow();
let exec = require('child_process').exec;
child = exec('node ./server.js');
child.stdout.on('data', function(data) {
console.log('stdout: ' + data);
});
child.stderr.on('data', function(data) {
console.log('stdout: ' + data);
});
child.on('close', function(code) {
console.log('closing code: ' + code);
child.kill();
});
}
app.on('ready', createWindow);
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') {
app.quit();
child.kill();
}
});
app.on('activate', function () {
if (mainWindow === null) {
createWindow();
}
});
main.js#!/usr/bin/env node
var express = require('express');
var app = module.exports = express();
var server = require('http').createServer(app);
var bodyParser = require('body-parser');
app.set('trust proxy', true);
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
app.use(require('cookie-parser')());
app.get('/', function(req, res) {
console.log('GET /');
res.send('<h1>foo lala</h1>');
})
var port = 1987;
var ipaddr = '127.0.0.1';
server.listen(port, ipaddr, function() {
console.log('Express server listening on port ' + server.address().port + ' at ' + server.address().address);
});
server.jsnpm start > electron-quick-start@1.0.0 start /var/www/electron-quick-start > electron main.js stdout: Express server listening on port 1987 at 127.0.0.1 stdout: GET /terminal
browser
The JS above was near identical, and the HTML was identical, to Electron's boilerplate, and package.json required modifying the additional packages. It's a good place to start!
Host yourAlias
HostName "$IP"
User "$USER"
RemoteForward 52698 127.0.0.1:52698
3. In your SSH environment, as root, do:# wget -O /usr/local/bin/rsub https://raw.github.com/aurora/rmate/master/rmate # chmod +x /usr/local/bin/rsub # shutdown -r now4. Henceforth, you may now access your SSH similar to what would be an alias:
$ ssh yourAlias5. Restart Sublime, SSH in, and there will be an added advantage of being able to edit files via your local environment's Sublime Text editor.
$ ice --local build -t $IMAGE_NAME:$TAG $DIR
The first step of working with Bluemix is to create a local image. This step is analogous to creating an image in Docker. The main difference is that the build produced here can be pushed to the IBM Bluemix cloud repository. Bluemix can connect to Dockerhub, however, it can also host your images privately out of the box, and sync with your local Docker daemon images.
SUPPORT$ ice --local tag $IMAGE_NAME $REGISTRY_URL/$NAMESPACE/$IMAGE_NAME:$TAG
$ ice --local push$REGISTRY_URL/$NAMESPACE/$IMAGE_NAME:$TAG
The local image is now tagged, and pushed to the IBM Bluemix cloud repository for use to add to a container in the following step.
SUPPORT$ ice run --name $UNIQUE_CONTAINER_NAME $EXPOSED_PORTS $NAMESPACE/$IMAGE_NAME:$TAG
This piece may throw some people off base, and for good reason: "How come is it when I delete a container that I can no longer use that container's name?". Indeed, each time you apply an image to a cloud container, the cloud container needs a unique name that was never used before. Otherwise, you'll soon find that there will be an exception that the container already exists. It's a cloud repository after all. Therefore, assign a new name for a container each time you decide to run this command.
After this step you're done! You can of course, continue either by having access to a public IP address or by making code edits, and having to handle changes thereof.
SUPPORT$ ice ip request
The next step is self-explanatory. I hope you can foresee that you'll then have to assign this IP address to your cloud container for it to do anything useful. You may also derive a public IP address by utilizing the IBM Bluemix GUI instead of the CLI.
$ ice ip unbind $PUBLIC_IP_ADDR $OLD_CONTAINER_NAME
$ ice ip bind $PUBLIC_IP_ADDR $UNIQUE_CONTAINER_NAME
In case you'd like to bind a public IP address, for instance to access various ports inside your application, you will have to bind them. I have been avoiding to run this step if another container is using the public IP address my clients utilize. This is preceded by unbind or stopping and removing the other container running the application. Of course, be careful when removing your container as it can no longer start. You may keep previous container(s) to revert in case your new adjustments have corrupted your code.
$ ice logs $UNIQUE_CONTAINER_NAME
The ability to log was a paramount concern. In addition to options such as SSH to your container, you can login to your IBM Bluemix from a Docker VM environment, and view your logs in real time.
$ ice rm $OLD_CONTAINER_NAME
Let's get rid of the previous, inactive, and unbound container for good measure and housekeeping.
To remove previous images, simply get rid of them from local and cloud
$ ice --local rmi $REGISTRY_URL/$NAMESPACE/$IMAGE_NAME:$TAG
$ ice --local rmi $NAMESPACE/$IMAGE_NAME:$TAG
$ ice --cloud rmi $NAMESPACE/$IMAGE_NAME:$TAG