the menu is failed to opened using monkeyrunner touch command - touch

i want to open "Choose input method" popup menu from settings application. Using monkeyrunner touch command, the screen is taped, while the menu is not opened.
Here is the reproduce steps:
environment: emulator (android sdk 4.1)
Go to System settings -> Launguage & input view
try to tap the text "Default" using monkeyrunner touch command
python code:
device = MonkeyRunner.waitForConnection(10, "emulator-5554")
device.touch(83, 486, MonkeyDevice.DOWN_AND_UP)
Actually result:
the screen is taped, but the popup menu is not opened. Also reproduced with tap the text "Launage".
And i tried with android sdk 2.3.3 for this issue, the submenu for "Default" and "Language" could be opened.
if executed the adb command "adb shell input tap 83 486" on sdk 4.1, the menu could be opened.
Any ideas for this issue?

If you are using monkeyrunner to opne System setting -> Language and input view then you should place some *MonkeyRunner.sleep(x) along the way (where x is the time in seconds).
This way you'll make sure that the UI elements are created properly. If you do not place sleep(x) statements, the script will touch/ press without any lag/ timeout. But the android UI needs some time to create the views and other elements and make then functional.

Related

How to add a shortcut for "Launch the selected target in terminal window" button?

I use Visual Studio Code and the CMake extension (twxs.cmake). The extension integrates CMake to vscode. There is a button which allows us to run a target in terminal window. It looks like a play button. .
My question is, how can I add a keyboard shortcut for this button? I cannot find the action name so I cannot link it. I wish to use keyboard shortcut instead of clicking that button every time.
I tried googling the action name of this button so I could bind it with any keyboard shortcut, but I couldn't find anything.
Any help will be appreciated.
Thank you in advance!
Shift+F5 appears to do the same thing as clicking that button.
I found the following here:
Running Targets Without a Debugger
Sometimes one will want to just run a target and see its output. This
can be done with the CMake: Execute the current target without a
debugger command, or the associated keybinding (the default is
Shift+F5).
The output of the target will be shown in an integrated terminal.

I can't find the location to select for the target device in VS Code. (Flutter)

I usually use Android studio for application development with Flutter.
I'm trying to use VSCode, but as the title says, I can't find the selection of the target device I want to run.
For the time being, I selected [Run and Debug] from the icon on the left and executed it, and I was able to run the app on the actual iphone, but I want to run it on macOS.
I would appreciate it if you could tell me where it is.
At the very bottom of your editor, there is a bar, in this bar you should see the name of the currently selected platform, if you click on the platform, you will bring up a menu where you can select the device.
here is a closeup:
In my case you would click on "windows (windows-x64)"
You can also press Ctrl+Shift+P and write Flutter: select device to bring up the same menu

viscose not showing connected device at the bottom

I'm sure there was a place for selecting device...if connected, it show phone like SM960 , or iPhone .
but suddenly, I can't see this also I can't run code from play button on vscode. (start without debugging)
what happened?
Close the VSCode and again open VSCode as Admin. Than it will show the connected Devices.
The vscode flutter pluggin must be used with vscode oppened as admin.
Make sure to use
ctrl+ shift +p
to select device
It is Easy Just right click on The vs code Bottom Bar. You will Get a list of Item then Click on Flutter devices,

Android-emulator AVD Window Size [duplicate]

This question already has answers here:
How to resize the AVD emulator (in Eclipse)?
(11 answers)
Closed 7 years ago.
My question seems to be stupid, but I really could not solve it.
I am using eclipse to develop android applications, but when I run the emulator AVD it has a fixed window size (very huge on my computer screen), so I can't see the rest of the Android screen.
Can you help me?
If the size of the emulator is too big. You can resize it by:
Run > Run Configurations
Pick the "Target" tab
Scroll down to Additional Emulator Command Line Options and put in: -scale 0.8 or another number
Here can help you:
Menu -> Windows -> Android SDK and AVD manager
Choose your AVD then select Edit button
In line Skin you choose HVGA for built-in or custom your size resolution...
HVGA will allow the emulator to fit on your screen.
type this command
adb emu window scale 0.6
Here's what worked for me:
In eclipse, go Run -> Run configurations.
Select the Target tab.
In the Additional Emulator Command Line Options field type -skin ­­320x480 or some other resolution appropriate for you.
Click "Apply" button.
Click the "Run" button.
I tried the -scale 0.8 option but it didn't work well because although the screen size was reduced, the color looked like 8 bit color... or worse. It was entirely unusable since the flash screen was almost entirely white.
The -skin ­­320x480 option produced an emulator of an appropriate size with no graphics issues.
Go to Android AVD manager and chose the device.
Click start >> Launch options >>> Scale display to real size >> screen size >> 6
This is simplest one
Go to Run
Open command prompt
Type: telnet localhost 5554 or telent localhost EMULATORID
Then you will get Android console
Type this command window scale 0.7 or window scale <value from 0 to 1>.
And if you are using Windows 7 then you have to first activate your telnet client.
for this follow these steps:
Go to control panel
There is icon named Programs below that Uninstall program is there click on it.
Then click on the turn Windows features on or off at left most to your screen
One list will be pop up just tick on the telnet client
And then click on OK
For testing go to command prompt and type telnet if you will not get error then telnet is working
This will do exactly what you would like to do, which is leave the emulator screen resolution alone while allowing you to scale the emulator window.
Select the menu item Window/Android SDK and AVD Manager/Start
Check Scale display to real size, (you can then set the screen size in inches on this page)
Click Launch.
The skin size the way you want it will appear, no app will be running. Wait for the launch to complete. Eclipse and Windows might not be not happy if you try to start your app during the skin launch.
Start your app (with F11 for instance).
You may get a dialog about attaching to a running emulator. Do so.
For Android Studio (0.6.1 at time of writing):
Click Run>Edit Configurations
Select module you want to alter under 'Android Application' expandable list on left
Click 'Emulator tab
Make sure 'Additional command line options' is selected and type: -scale 0.5
Hit 'OK' and run your app!
A simple solution with Android Studio is:
- launch the adv manager
- Select the emulator line you want
- hit the edit button on the right (a pencil)
- In the middle of the configuration screen that opens there is a Scale radio field - choose the ratio between device and screen that you prefer. I have chosen "4dp on device = 1px on screen" and the resulting size is just what I wanted (using Nexus 5).
- Hit Finish
Run configurations-> target-> Addition emulator command text box
write
"scale 0.6"
(without quotes)
in linux is easy
How do I launch the Android emulator from the command line?
you need to add at the end this "-scale 0.45"
for example: /home/hackro/Documentos/Software/adt-bundle-linux-x86_64-20140702/sdk/tools/emulator64-x86 -avd Android5.1.1 -scale 0.45
I have shortcuts in my menu of the linux and they work well

Xcode 4: How do you view the console?

I can't seem to find a way to have the console run (to show NSLog comments) in XCode 4. The normal method for the previous version of XCode does not work. Does anyone have an idea of how to accomplish this?
You need to click Log Navigator icon (far right in left sidebar). Then choose your Debug/Run session in left sidebar, and you will have console in editor area.
for Xcode 5:
View->Debug Area->Activate Console
shift + cmd + c
If you just want to have the log output display when you run your app then you can go into XCode4 preferences -> Alerts and click on 'Run starts' on the left hand column.
Then select 'Show Debugger' and when you run the app the NSLog output will be displayed below the editor pane.
This way you don't have to select on the 'up arrow' button at the bottom bar.
The console is no extra window anymore but it is under the texteditor area. You can set the preferences to always show this area. Go to "General" "Run Start" and activate "Show Debugger". Under "Run completes" the Debugger is set to hide again. You should deactivate that option. Now the console will remain visible.
EDIT
In the latest GM Release you can show and hide the console via a button in the toolbar. Very easy.
Here' an alternative
In Xcode 4 short cut to display and hide console is (command-shift-Y) , this will show the console and debugger below ur text edior in the same window.
You can always see the console in a different window by opening the Organiser, clicking on the Devices tab, choosing your device and selecting it's console.
Of course, this doesn't work for the simulator :(
There's two options:
Log Navigator (command-7 or view|navigators|log) and select your debug session.
"View | Show Debug Area" to view the NSLog output and interact with the debugger.
Here's a pic with both on. You wouldn't normally have both on, but I can only link one image per post! http://i.stack.imgur.com/4gG4P.png
Here's an alternative.
In XCode4 double-click your Project (Blueprint Icon).
Select the Target (Gray Icon)
Select the Build Phases (Top Center)
Add Build Phase "Run Script" (Green Plus Button, bottom right)
In the textbox below the Shell textfield replace
"Type a script or drag a script file from your workspace" with
"open ${TARGET_BUILD_DIR}/${TARGET_NAME}"
This will open a terminal window with your command-line app running in it.
This is not a great solution because XCode 4 still runs and debugs the app independently of what you're doing in the terminal window that pops up.