android Studio Logcat not working while debugging on HUAWEI Phone - logcat

My Logcat stopped working with my "developer device" Huawei Y5.
I use Android 3.5.1 fully updated, until two days ago all was working fine, now suddenly my App logs dont show up anymore. The logcat shows the following errors:
2019-10-18 08:25:32.075 7043-7074/com.android.example.contentresolvercheck E/MemoryLeakMonitorManager: MemoryLeakMonitor.jar is not exist!
2019-10-18 08:25:32.141 7043-7099/com.android.example.contentresolvercheck E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile#cb81960
2019-10-18 08:25:32.195 7043-7099/com.android.example.contentresolvercheck E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile#9623ede
And later (I think on every Log entry):
2019-10-18 08:25:33.031 7043-7157/com.android.example.contentresolvercheck E/GED: Failed to get GED Log Buf, err(0)

Did you open the AP log switch before? If not, try follow this:
Touch the phone icon on the phone.
Enter ##2846579##.
Access the project menu and click Background Settings.
Select AP Log Settings.
Open the AP log setting page.
Click Open to view the log.

Related

Uiautomatorviewer Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist

i can launch Uiautomatorviewer sucessfully, inspect any page/app at personal profile.
Once phone at work profile/launching any app installed under work profile then Uiautomatorviewer throws error:
Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!
i am not sure why it behave like this suddenly, it used to work regardless personal / work profile last week.
i don't remember i change any configuration...
please help to give me clues why? i have followed many previous post suggestion to restart adb server, kill appium server, restart phone/laptop, disable enable developer options...etc. none works....
I tried to inspect personal profile now, the same error occurred:
Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!
updated: i used appium studio inspector and it works. I still not sure what happened to adb or uiautomator via command line? how do i debug it?
found an answer
com.android.ddmlib.SyncException: Is a directory
try doing adb shell rm -rf /data/local/tmp and rebooting the phone first. it's ok if you get rm: /data/local/tmp: Permission denied. ignore it - it's for the tmp folder itself after its content was already removed (that's what you need anyway)

“choregraphe-suite-2.8.6.23-mac64-setup” cannot be opened because the developer cannot be verified

I am trying to install Choregraphe Suite on my macOS Catalina (v10.15.7) from the softbankrobotics website but I get this message:
Website link: https://developer.softbankrobotics.com/nao6/naoqi-developer-guide/choregraphe-suite/choregraphe-suite-installation-guide#desktop-installation
I don't know what I'm missing in order to run the installation on my laptop. I would appreciate it if anyone can help me on this.
Update: I left clicked it and it opened in command line. I went into the choregraphe-folder/bin/naoqi-bin and when I executed the file I got this:
Last login: Sat Nov 7 09:05:34 on ttys000
/Users/name/EEP_work/choregraphe-suite-2.8.6.23-mac64/bin/naoqi-bin ; exit;
name#Mahlas-MBP ~ % /Users/name/EEP_work/choregraphe-suite-2.8.6.23-mac64/bin/naoqi-bin ; exit;
dyld: Library not loaded: #rpath/QtCore.framework/Versions/5/QtCore
Referenced from: /Users/name/EEP_work/choregraphe-suite-2.8.6.23-mac64/bin/naoqi-bin
Reason: image not found
zsh: abort
[Process completed]
Thanks :)
You can go to the system settings > security & privacy and explicitly allow the opening of the installer (screenshot attached).
allow opening of installer
It will then bring up a second dialog:
"macOS cannot verify the developer of “choregraphe-suite-2.8.6.23-mac64-setup”. Are you sure you want to open it?
By opening this app, you will be overriding system security which can expose your computer and personal information to malware that may harm your Mac or compromise your privacy."
You can then click on "Open", but for my Mac (10.15.7) the installer crashes directly afterwards and I cannot install anything.
allow installation
It seems impossible to install Choregraphe on a recent Mac OS X. Help would be much appreciated.
'Allow install from internet' is the step you have to go over for all 3rd party apps(always happening) for macs. But still 'choregraphe' setup file didn't worked.
I hope my solution helps, i searched a lot too :)
install not setup file, try binaries oneenter image description here, and unzip. Open file you will see 'choregraphe' unix executable file, i clicked that file and app worked, best
P.s. i am not expert or anything that is only way i was able to make it work for my MacOs 10.15.7 (Catalina)

getting error while using logcat for checking logs of an app in linux

I want to know bugs of my android app so i tried to use logcat to see its log and followed these steps:-
You need to use adb server.
1. Connect your android with your laptop/pc
2. Go to developer options and turn on the stay awake and USB debugging options. (Your phone)
3. In your terminal, type "sudo adb kill-server" and then "sudo adb start-server".
4. Type "adb devices" (this should give list of devices connected)
List of devices attached
you_device_name device
5. "cd" to your folder where you have made your build.
6. Type "buildozer android debug deploy run logcat > logcat.txt"
this saves the logs (for the entire process) in a file logcat.txtx in the same folder and also deploys you app on the phone.
Go through it and find your error.
7. keep your phone awake.(do not lock it).
But when i run the 6th step, a time comes it says:-
error: device 'adb' not found
- waiting for device -
i have searched many times on the internet and when finally i am posting here to get solution
I actually initially misread the bulldozer error. It is complaining that a device adb doesn't exist. Which is strange. It should have picked up the device serial instead.
You could theoretically force adb commands to go to your device by executing
export ANDROID_SERIAL= <your device's serial number>
you could now repeat the steps and check if this works.
Also just for completeness just check if there exists an adb binary in the system partitin of your device.
Also make sure you haven't missed out any bulldozer init steps

How do you debug react-native when it is running on device?

How do you debug react-native when it is running on device ?
Figured our React Native debugging for Android. Steps to for someone struggling with this -
Launch your RN App
Shake device
Select "Dev Settings"
Select "Debug server host & port for device" Put in your system's IP address.
Shake device
Select "Debug JS remotely"
Chrome will open a new tab with the address "http://localhost:8081/debugger-ui"
If this doesn't happen, check your port and open a new tab and enter the above address with your port number.
Open #Chrome DevTools (Cmd+Alt+I on #MacOSX)
Select the Console Tab
Shake Device
Select "Reload"
View all your console logs or use "debugger;" in your JS for breakpoint debugging.
You have two options:
Debug remotely
iOS: Cmd + ctrl + z to open menu and select "Debug remotely"
Android: Cmd + M to open menu and select "Debug remotely"
Or run one of these commands:
react-native log-ios
react-native log-android
There are little hack in here for IOS.
In XCode open AppDelegate.m from project folder, comment the line with jsCodeLocation declaration and add near it something like this:
jsCodeLocation = [NSURL URLWithString:#"http://%YOUR_PC_IP%:8081/index.ios.bundle?platform=ios&dev=true"];
, where %YOUR_PC_IP% is IP of your dev machine on local net.
Then open project named RCTWebSocket wich located in Libraries folder and then open from this project file RCTWebSocketProjectExecutor.m. Next, comment the line with host declaration, then add near it something like that:
host = #"%YOUR_PC_IP%";
Almost done. Run app on your device with XCode and make sure that your IPhone can see your develop machin via internet.
After it launches make sure that node server is running (command "react-native -- --start" in root project folder) and open via chrome this page: http://localhost:8081/debugger-ui . Plus, option Debug JS Remotely must be enabled in your app on your IPhone. (Shake action, then tap in opened menu Debug JS Remotely, that is it.)
Now open dev console and have happy debugging.
2 options exist:
Remote debug: this would go over network, so it can be laggy.
Run app on device (install it whilst its plugged in)
Shake device (Android devices need to be vigorously shaken)
Press settings on the dev menu, and under Debugging, press Debug server host and port for device
Enter your debug server's IP address and port (usually 8081 unless you changed your settings of the debug server), e.g. 255.255.255.255:8081. Your ip address is the local IP address that your computer has. Ensure the device is on the same network. For mac users, open System Preferences → Network → Wifi → Under Status: connected, there is an IP address, use that.
You can unplug the device
Ensure debug mode is on (Shake device vigorously again, press Debug)
Wired debug: relatively better for slow connections
Install app on phone
If android, set up port forwarding with adb reverse tcp:8081 tcp:8081 and if iOS, follow the steps from RN docs)
Enable debug on device
If you are working on Visual Studio Code then you can install React Native Tools extension (provided by Microsoft) and debug your app like any other IDE.
Read all steps in detail in my this answer.

Can't connect to localhost:8080 when trying to run Google App Engine program

I'm trying to run the Google App Engine Python 2.7 Hello World program and view it in a browser via Google App Engine Launcher. I followed the install and program instructions to the letter. I copied and pasted the code in the instructions to the helloworld.py file and app.yam1 and verified that they are correct and in the directory listed as the application directory. I hit run on the launcher and it runs with no errors, although I get no sign that is has completed (orange clock symbol next to app name). I get the following from the logs:
Running dev_appserver with the following flags: --skip_sdk_update_check=yes --port=8080 --admin_port=8000 Python command: /opt/local/bin/python2.7
When I try to open in the browser via the GAE Launcher, the 'browse' icon is grayed out and the browser won't open. I tried opening localhost:8080 in Firefox and Chrome as the tutorial suggests, but I get unable to connect errors from both.
How can I view Hello World in a browser? Is there some configuration I need to make on my machine?
I had the same problem. This seemed to fix it:
cd to google_appengine, run
python dev_appserver.py --port=8080 --host=127.0.0.1 /path/to/application
at this point there is a prompt to allow updates on running, I said Yes.
At this point the app was running as it should, also when I quit this and went in using the launcher again, that worked too.
I have to manually start python and make it point to my app folder, for instance in a command line window on Windows I am using python. I installed python in C:\Python27 and my sample app is in c:\GoogleApps\guestbook
C:\Python27>dev_appserver.py c:\GoogleApps\guestbook
and then I can start my app in the Google App Engine Launcher and hit localhost 8080
How about specifying --host argument? You can find it at the bottom of following doc.
https://developers.google.com/appengine/docs/python/tools/devserver
This might be a little late. But still someone might find it useful.
When ever you go and try changing the port number from 8080 to something else, it will not get updated. So the best option is:
Go to your user directory: eg: C:\Username
There will be a Google folder. Go inside
Open the file google_appengine_projects.ini
Change your port number from 8080 to whatever you like 8081
Save it and close the file.
Launch the GAE Launcher again and you will find the changes reflected and the app runs without issues.
7: Access the application using: http://localhost:NewPort/
This can be used to change ports both run port and admin port for your individual projects running locally.
Hope this helps!
The 8080 portion of your url is a port number. Firefox disables visiting url's of other ports by default. You have to enable them by doing the following: http://blog.christoffer.me/post/2012-02-20-how-to-remove-firefoxs-this-address-is-restricted/
Paraphrasing that website:
Open firefox and visit about:conf
In the Filter box, type in network.security.ports.banned.override
If you can't find such a preference, right click to open up the pop-up menu and pick New and then String
As preference name type network.security.ports.banned.override and 8080 as the value.
Done!
It's likely if this continues to not work that your browser is behaving properly (8080 is a fairly standard port). That means that its a problem with the server and we'd have to do some more debugging.

Resources