android版本:5.0.1
使用adb shell连接到设备
和pm list包显示我的包是com.example.jim.test10
通过运行run-as com.example.jim.test10
我得到错误:com.example.jim .test10未知
在app test10的清单中,debuggable设置为true
希望看到建议,谢谢
如果需要任何额外信息,请告诉我
我使用该Math.random()函数生成了W3School示例中建议的数字:
Math.floor((Math.random() * 10) + 1);
Run Code Online (Sandbox Code Playgroud)
示例描述说它''返回1到10之间的随机数"
我略微修改它以获得2到17之间的范围:
Math.floor((Math.random() * 17) + 2);
Run Code Online (Sandbox Code Playgroud)
但是,当我使用控制台测试它时,我得到了值18.
为什么我的代码返回的值超出了预期的范围?