How to get dev tools in built electron app? - electron

Is it possible to show the dev tools within a built electron app? The executable that I built using electron-packager is behaving differently from the app run using electron at the command line, and I have no way to see what kinds of exceptions are being thrown.

Yes it's possible to show the DevTools in a packaged app, just call someBrowserWindow.webContents.openDevTools(). If you want a menu item and/or keyboard shortcut to do it then you'll need to create and set your own menu for the browser window using someBrowserWindow.setMenu(someMenu).

Related

How does a UI app inspectors (like the one in Appium) work?

Appium has a way to inspect the view hierarchy of an app using an inspector. I am interested in building one myself.
I know the overview answer of: it uses some webdriver to accomplish this. But how?
It puzzles me that a separate iOS app can some how communicate to another app, and show even its screen.
How does it work under the hood? or how does the iOS app communicate to the UI inspector to send its screen shots and hierarchy?
It puzzles me that a separate iOS app can some how communicate to another app, and show even its screen.
Yes! Apps should not be able to do this. But there exists a special kind of app, built just for testing, which IS able to do this.
The way this is done is using Apple's XCUITest framework. When you write an XCUITest in XCode, it builds a special app which is able to start your test app and then communicate with it using the XCUITest methods. These methods allow you to inspect elements in the view.
In order to create a view tree, you start at the root view and iterate over the children, building out a tree with a tree traversal.
Normally, the XCUITest app exits when your test script finishes, which means you won't be able to access it from a desktop app for viewing the tree as it updates. If you write your test script to run an infinite loop and open a network port for communication with an outside process, now you can build your viewer. This is exactly what Appium does, so I suggest you check out the appium source code and maybe just use that?
More information in this blog post
[edit]: Oh yeah, Appium uses Feacebook's WebDriverAgent project as the script that runs on the app. So WebDriverAgent is basically an XCUITest script which runs a server and can take commands during a test. Appium does a ton of work to bundle and package it into the special kind of companion app that is able to access your app, installs it on the iOS device, and then runs the test. WebDriverAgent has a command which iterates over the UIHierarchy and returns the whole tree.

Updating Electron app

The Electron framework from GitHub has a feature that lets you automatically update your app by using some server utility called Squirrel. What I am wondering is whether an Electron app can simply just update itself without depending on any server utility. Since an Electron app is basically a web-based app using HTML and Javascript, couldn't you just create an "empty" app that has no UI or code other than some bootup Javascript code that downloads the entire UI and other scripts to run the app?

What applescript commands can be sent to iOS Simulator?

I know you can tell the iOS Simulator to quit with applescript. Can you tell it to go "home" from the current app? And then click on the app's icon to relaunch it? This would be useful for me for Application Tests that need to verify background tasks complete and numerous other cases.
Any AppleScriptable app must export a scripting dictionary in order for AppleScript to know what its commands are. You can see any app's dictionary by opening the app in Script Editor.
Note that even if an app doesn't provide script commands for what you want, System UI Scripting or Automator can likely still be used to drive its UI. (For example, to choose the Home or Rotate commands in iOS Simulator's menu bar.)
There's also iOS-specific UI automation stuff you can do from the Instruments app that comes with Xcode.
The iOS Simulator does not directly support AppleScript. It doesn't have a scripting dictionary. This means that the only real way to manipulate it in AppleScript is to use the UI commands that work for any application.

Cannot launch a app with Chrome extension with forge (trigger.io)

I have created the app with forge, and have added in the chrome extension, but when i run with chrome, always show the following errors:
Currently it is not possible to launch a Chrome extension via this interface.
The required steps are:
1) Go to chrome:extensions in the Chrome browser
2) Make sure "developer mode" is on (top right corner)')
3) Use "Load unpacked extension" and browse to D:\mobile-app\test/development/chrome
but I really done with above steps, I don't know what happen.
and I want to know how can I use difference Android sdk and resolution simulator with testing?
thanks!
Chrome doesn't a way for us to automatically install browser extensions. Therefore, you have to install your extension manually.
To do that, in Chrome (see image below):
type chrome:extensions in the address bar
turn on developer mode
click Load unpacked extension
If you have a separate question about Android SDKs, probably best to ask that in a different thread, or contact support#trigger.io.
I had the same issue, using:
forge run chrome
to try to run the app in the Chrome web browser. I thought the 3 steps given were to install an extension which would then allow forge run chrome to launch the web application. I couldn't understand why, after installing the extension (with no button defined of course), nothing seemed to change. I didn't realise a Chrome extension version of my app, appearing on the toolbar, was even possible!
I should have used:
forge run web
to launch the app in the (default) browser.

Running BlackBerry application automatically directly after installation

I have written an application that injects some menu items in other BlackBerry applications (for example a "bookmark this page" menu item in the BlackBerry browser). I have configured the application to be run automatically at startup (of the device) so when the device starts, the menu items are installed in the other applications.
However, I would also like to have my application started directly after installation (via OTA), so the menu items are directly available to the user. Is there a way to accomplish this without having the user to reboot the device or manually start the application after installation?
Autostart applications should run
automatically after they have been
installed. What could have happened
is the application tried to autostart,
but didn't have the permissions to do
what it wanted and failed with a
ControlledAccessException. Often this
can be seen as the application failing
to start, but in fact it did start but
just wasn't allowed to do what it
tried to do.
Check the event log on the BlackBerry
(alt+lglg). You should see an entry
for your application being started
after it was installed.
Mark Sohm BlackBerry Development
Advisor www.BlackBerryDeveloper.com
BB Support Community Forums :Can we automatically run the application after install

Resources