惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - zjhgx

hjdang 从jdk11升级到jdk25遇到的问题 腾讯云服务器遭受大量请求攻击导致网页打不开 capacitor的android项目接入穿山甲遇到的坑 class file for org.apache.shiro.lang.util.Nameable not found class file for org.apache.shiro.lang.util.Nameable not found 使用capacitor遇到的问题记录 shiro的cookie去掉domain后导致用户无法登陆 用java爬取京东商品页注意点 SEO 经验记录 使用goaccess统计nginx日志 nginx日志按天分割 记一次流量爆发导致服务器无响应的记录 mac 安装完Navicat Premium 提示已损坏 无法打开的处理方法 腾讯云问题汇总 vue-element-admin npm install 错误 quasar <q-page>下面<div>自动计算height的问题 Adsense遇到的问题 web项目启动时dubbo报错: No provider available for the service com.davidhu.shopguide.api.service.UserEventService from the url zookeeper ://localhost:2181/org.apache.du quasar ssr模式出现了CLS issue vue ssr里面在template不能出现this,create时this还没有
android真机调试遇到的问题
zjhgx · 2025-04-16 · via 博客园 - zjhgx

由于想把hjdang.com用quasar提供的capacitor模式打包成apk。结果在调试时各种问题。

1. 在quasar dev -m capacitor -T android 然后自动打开了android studio开始build。在提示下不小心升级了Gradle,结果发生报错:Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. 删掉了.gradle目录没用,需要删除src-capacitor, 然后重新quasar mode add capacitor

2. 用USB连接手机和mac,想用chrome的 chrome://inspect/#devices 功能调试h5,结果遇到“Pending authentication: please accept debugging session on the device.”的问题

解决:

进入开发者选项 -> 撤销USB调试授权 ->关闭USB调试->拔掉连接线 -> 打开USB调试-> 重新插上USB线 ,手机上会跳出 仅充电-数据传输-照片传输的选项,选数据传输

3. 为了看下relaese包里为何阿里云的图片显示不出来,看App里的请求Refer是什么(加了防盗链)Android用clarles抓包时在安装了根证书之后发生了ssl shake hand错误。

SSL handshake with client failed: An unknown issue occurred processing the certificate (certificate_unknown)

解决 根据clarles文档:https://www.charlesproxy.com/documentation/using-charles/ssl-certificates/

As of Android N, you need to add configuration to your app in order to have it trust the SSL certificates generated by Charles SSL Proxying. This means that you can only use SSL Proxying with apps that you control.

In order to configure your app to trust Charles, you need to add a Network Security Configuration File to your app. This file can override the system default, enabling your app to trust user installed CA certificates (e.g. the Charles Root Certificate). You can specify that this only applies in debug builds of your application, so that production builds use the default trust profile.

Add a file res/xml/network_security_config.xml to your app:
<network-security-config> 
  <debug-overrides> 
    <trust-anchors> 
      <!-- Trust user added CAs while debuggable only -->
      <certificates src="user" /> 
    </trust-anchors> 
  </debug-overrides> 
</network-security-config>
Then add a reference to this file in your app's manifest, as follows:

<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
    <application android:networkSecurityConfig="@xml/network_security_config" ... >
        ...
    </application>
</manifest>

注意这个时debug包。

4. 在android studio模拟器上调试,在“Medium Phone”模拟器上网络连不上,换到Pixel 7 Emuler 上网络就能用了,百度可以打开。具体原因还未知

5. 在Pixel 7 Emuler上运行时 webview上网页无法打开:android studio net:ERR_CLEARTEXT_NOT_PERMITTED

这是由于不是https的请求:

解决方法:https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted/50834600#50834600

Option 1 -

First try hitting the URL with https:// instead of http://

Option 2 -


Create file res/xml/network_security_config.xml - <?xml version="1.0" encoding="utf-8"?> <network-security-config> <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">api.example.com(to be adjusted)</domain> </domain-config> </network-security-config> AndroidManifest.xml - <?xml version="1.0" encoding="utf-8"?> <manifest ...> <uses-permission android:name="android.permission.INTERNET" /> <application ... android:networkSecurityConfig="@xml/network_security_config" ...> ... </application> </manifest> Option 3 - android:usesCleartextTraffic Doc AndroidManifest.xml - <?xml version="1.0" encoding="utf-8"?> <manifest ...> <uses-permission android:name="android.permission.INTERNET" /> <application ... android:usesCleartextTraffic="true" ...> ... </application> </manifest>

6: android studio模拟器运行hjdang打开后,chrome上输入chrome://insepctor/#devices调试android studio 里android里的h5页面,可以看到Remote Target里有页面了,但点击inspector跳出的对话框是黑屏,过了好久显示404.打不开,原因是网络没有FQ,打开vpn就能连上了。国内网络连不上

7. Android Studio 使用AVD时,一直停留在Waiting for Target Device to Come Online,模拟器状态显示为OFFLINE
网上的方法大多是以下几点:

现象

在发布一个app的时候,每次走到waiting for all target devices to come online之后,就没有后续了,模拟器没有调起来,更不用谈后续的install。

原因

暂时不明

解决方法

在网上搜索的有很多种解决方法,但是对我的问题都没有效,但是也把这些方法罗列下来做一个记录。

a.在avd maanger中,选择Wipe Data擦除,然后在重启app。

b.重启Android studio,重启系统。

c.在paltform-tools目录下,执行adb kill-server,然后执行adb start-server。

d.更新SDK tool或者paltform tool。

e.删除C:\Users\Administrator.android\avd\Pixel_XL_API_28.avd目录下.lock文件,然后重新载入。

上述五种方法我都尝试过,但是对我都没有效果。后续我尝试在avd manager中选择 Cold Boot Now,先把模拟器启动,然后在运行app,发现有效。

8. 由于在android stuido上调试需要用chrome://insepctor上调试h5,然后又必须开vpn否则黑屏无法调试,但开了vpn发现java端的dubbo就无法调用(还不清楚原因),后来看zookeeper日志

EndOfStreamException: Unable to read additional data from client, it probably closed the socket: address = /127.0.0.1:64966, session = 0x0

看用到了socket,然后我关闭了mac网络设置中的代理设置中的SOCKs proxy,然后就好了

9. android启动打开模拟器,这是一般会出现网络UNREACHERABle的错误,打开模拟器的chrome无法上网。但只要点开网络设置也不需要改什么然后网络就能用了。好奇怪。

10. 在android studio的模拟器调试app里的h5。打开chrome://inspector. 连接很不稳定,没一会就不能调试断了,基本不可行。不知道原因

11. 用android studio真机调试app时,手机通过usb连接到电脑后发现在Runing Device里的手机画面是无法实时变化的,这就说明连接有问题,是无法正常启动安装app的。这时如果通过进入开发者选项 -> 撤销USB调试授权 ->关闭USB调试->拔掉连接线 -> 打开USB调试-> 重新插上USB线 还无法解决。这时要先启动模拟器调试,然后再连接手机不知道为什么就好了,很奇怪。

1

1

1

1

1

1