In android 7.1.2 we can split the window in to 2 parts.
Like that, can we split the window in to 3 parts (AOSP)?
I have followed this link https://source.android.com/devices/tech/display/multi-window
I got solution,
Just have to run command using adb.
adb shell settings put global enable_freeform_support 1
Related
I'm always working with multiple nodejs projects, and every time I debug a new terminal is opened so I'm constantly getting lost on which terminal corresponds to each debug session.
Is there some way to do something like double clicking the debug session in the call stack and open the terminal it corresponds? Any insight would be greatly appreciated.
Thanks.
Based on my personal experience, looking at all the logs in one terminal makes it more confusing.
I have a better alternative for you, so let say you are debugging A and B projects.
Open A project in one window of VS code and use an integrated terminal
Open B project in another window of VS and use integrated terminal
and so on...
(To open the integrated terminal, Mac: Cmd + j and for Windows: Ctrl+` )
Windows:
Ctrl + Shift + P
Mac:
Cmd + Shift + p
And running those hotkeys type: Terminal: Rename, now you can change the terminal title
You could also add a keyboard shortcut for this command: workbench.action.terminal.rename
in addition to the answers, my approach is isolate the VS by opening different windows for different sessions, and keep the 2 windows on 2 different monitors, for that you need an extra monitor.
when i had 1 monitor, identifying which window corresponded to which was a time waste task and more of distraction. now attaching extra monitor to laptop has saved me a ton of time, organizing windows and switching between became seamless and of course most importantly, productivity and speed increased around 33%.
I am trying to create a Dart console application that runs in the terminal rather than the Debug Console in Visual Studio Code.
Currently, when I press the play button:
It runs in the Debug Console. The problem with that is that the Debug Console cannot get user input from the line:
String userInput = stdin.readLineSync();
I know I can run the dart file from the terminal with:
dart C:\Applications\Dart\hello_world\bin\hello_world.dart
But I would prefer to use the play button out of convenience.
I found that you can edit the launch.json file to specify where it should run but it is not working. Even with the change shown in the picture below, it still runs in the debug console. In the picture you will notice a warning regarding how it only works with version from v2.7.1
I guess I was optimistic that the line "only supported for Dart SDKs from v2.7.1" was implying "SDKs from v2.7.1 and up.". However, it mostly likely means that version of the Dart SDK only.
Any help in achieving the goal of running a Dart file in the terminal using the Run button would be greatly appreciated.
If this is not possible, why would they take that functionality out of the newer Dart SDK's?
Your launch.json file is Ok, just check the file name. The main problem is that you use the debug button from the upper-right corner of the editor, but this button does not accept settings from launch.json.
You should use debug panel on the left side, as shown in the screenshot:
Make sure configuration's name (to the right of the green arrow) matches one from launch.json.
As I'm working with Node.js and Angular, I've currently work with two terminals where I have to switch terminal by the dropdown option.
Is there a way to have two terminals (split) in the same place
like this:
Couldn't find a way.
Update - Visual studio code has this feature starting with version 1.21
Split terminals
The Integrated Terminal can now be split such that multiple are visible at once, which can enable much easier management of terminals when you need a watch and a run command for example:
Open the article to see the GIF demonstration.
Splitting can be done by clicking the split button in the panel, through the context menu or the command Ctrl+Shift + 5.
....
Before VS Code introduced the feature
Inside vs code
You can configure your console to bash or cygwin, and then install and use tmux or screen.
Initial answer before I understood the question intent was to do it inside vs code
Outside vs code
On windows
I'm using Cmder.
It allows opening multiple cmd tabs, and configure more types of command lines / tabs - such as bash, nodejs etc.
On Linux
I got to play a bit with tmux and I heard it's a good option.
Screen shot from google:
On Mac
As Brad stated - tmux works also on Macs, so have a look at the Linux section above.
VSCode has added support to split the integrated terminal in february 2018, as requested by this issue.
At the time it is not yet released, you need to install the Insiders version of VSCode.
You have to set the keybindings yourself, the default are still being discussed here.
As of June 2021, you can select the terminal then enter command: ctrl + shift + 5.
I recently updated Visual Studio Code to a new version (1.7.2) on my Mac.
I am used to open different 'windows' of VS Code at the same time on different projects.
In previous versions of VS Code I could navigate the VS Code open windows via 'cmd+>' (or 'cmd+z', now I do not remember this exaclty).
Now this key combination does not work anymore and, to navigate windows, I need to open the 'Window' menu option and chose from there.
Does anybody know how to navigate among open VS Code open windows on Mac with this version of VS Code?
Thanks in advance
control+w is working for me
It is showing all active windows
cmd+< is not provided by VSCode, it's a global shortcut of OSX witch works for all applications with multiple windows. You can check if its properly set up in Preferences->Keyboard->Shortcuts
However, there is a command in VSCode to select open windows from a list. Search the command palette for Switch Window, you can bind it to a shortcut yourself, command is called workbench.action.switchWindow.
I am using Genymotion for running android application.
Could any one tell me how to capture screen shot in Genymotion ?
If you are using Android Studio or Eclipse, you can just click the button "Screen Capture" in the Android DDMS:
You can use adb to get the screenshot from command line:
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
This article has the details:
http://blog.shvetsov.com/2013/02/grab-android-screenshot-to-computer-via.html
To make my life easier, I made an alias in .bash_profile:
alias screenshot="adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/Downloads/android_screenshot.png"
Now I can type screenshot in Terminal and get a screenshot of currently running emulator in my Downloads directory.
Disclaimer : I'm part of the same company as the Genymotion team.
This feature is included in the product. It is one of the paid feature of the screencast widget. Look at the pricing page here.
Two ways to access it:
pay for the pro or indie licence
use the trial version, it offers you the indie features. Be careful, there is only one trial day left :-/
Once your VM is started, open the screencast widget
Then take a picture with the dedicated button
UPDATE: You have bellow another ways to take a screenshot using Android Device Monitor or the command line
Use this commands:
Windows:
C:\"Program Files"\Genymobile\Genymotion\tools\adb shell screencap -p "/mnt/sdcard/output.png" && C:\"Program Files"\Genymobile\Genymotion\tools\adb pull "/mnt/sdcard/output.png" "C:\output.png" && C:\"Program Files"\Genymobile\Genymotion\tools\adb shell rm "/mnt/sdcard/output.png"
Note: Make sure you have permission to write to C:\output.png; otherwise, change it to whatever path you like.
OS X:
/Applications/Genymotion.app/Contents/MacOS/tools/adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/Desktop/Android_Screenshot_$(date +%Y-%m-%d-%H-%M-%S).png
Select genymotion simulator
Hit shortcut key describe below
Windows : Ctrl+Shift+S
Mac : Cmd+Shift+S
You can find your screenshots at desktop
I think you can also take videos for free. Genymotion uses VirtualBox to do almost all the heavy lifting, so you should open VirtualBox and look at what you can do in it.
You will find options in Virtualbox to capture video!
adb shell screencap -p /sdcard/screen.png
If your Mac is slow and you hate running Eclipse and the emulator together here is a quicker way.
Export your apk.
Start Genymotion.
Drag the apk to the emulator, in order to install it.
Go to 'android-sdk-macosx>tools>ddms'.
Run that file.
A new instance of ddms will be started. Unlike Eclipse, it doesn't slow down your system.
Use the 'Menu>Device>Screenshot' option to take screenshot.
This is a good option for those using slow computers.
If you are using Eclipse, then follow the steps for any type of emulator:
1. Select DDMS
2. In Devices window of DDMS select Genymotion device
3. Click on Camera icon then save it to specific location.
For Linux and Windows (I used gitbash on windows)
adb shell screencap -p | sed 's/\r$//' > screen.png
For Mac
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
#Reck says there's a bug in the Genymotion implementation so we can't take screenshots on 2.3.7. This means that Android Studio / DDMS can't get the proper pixels. adb shell screencap says there's no screencap command.
Assuming you have access to the code you can simply call this method:
public static void screenshot(View view) {
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
view.draw(new Canvas(bitmap));
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
try {
File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
storageDir.mkdirs();
File file = File.createTempFile(timeStamp, ".png", storageDir);
bitmap.compress(Bitmap.CompressFormat.PNG, 0, new FileOutputStream(file));
Log.i("SCREENSHOT", "adb pull " + file);
} catch (IOException e) {
Log.e("SCREENSHOT", "Cannot save screenshot of " + view, e);
}
}
In Activity:
screenshot(getWindow().getDecorView());
In Fragment:
screenshot(getActivity().getWindow().getDecorView());
The only limitation I know is that it won't include the status bar.
if you use Mac, sometimes CMD + Shift + 4 (screenshot of a selected portion in OSX ) and then selecting the simulator region is enough :)
Take a screenshot
On many Android devices, you can capture a screenshot with a key-combination: Simultaneously press-and-hold Power and Volume-down. You can also capture a screenshot with Android Studio as follows:
Run your app on a connected device or emulator. If using a connected device, be sure you have enabled USB debugging.
In Android Studio, select View > Tool Windows > Logcat to open Logcat.
Select the device and a process from the drop-down at the top of the window.
Click Screen Capture on the left side of the window.
The screenshot appears in a Screenshot Editor window
It Works for even Genymotion Emulator
Check here for further information